Showing posts with label excel. Show all posts
Showing posts with label excel. Show all posts

Thursday, March 22, 2012

Can not connect to AS 2005 from Excel

I'm having issues connecting to AS 2005 sp1 from Excel 2003. I have tried
two configurations as follows:

Secario 1
Installed on a Windows Server 2003 is AS 2005 sp1.
Installed on a workstation with XP sp2 is Office 2003, msxml parser 6.0, SQL
Server AS ADOMD, Excel Add-in for SQL Server Analysis Services sp1.

Secario 2
Installed all on workstation with XP sp2: Full install of SQL Server 2005
Dev Edition, Office 2003, msxml parser 6.0, SQL Server AS ADOMD, Excel
Add-in for SQL Server Analysis Services sp1.

In both cases the error returned is server does not exist or is too busy.

The cube is created and can be browsed from BI Studio.
The LAN id has been added to the AS 2005 security.
All SQL Services are started including Browser and AS.
Firewalls are not enabled.
Local and remote clients are allowed to connect to AS.
I can open TCP port 2383 with telnet on the AS server from the workstation.

Any one see anything I've missed or can shed some light on why the server is
not allowing connections?

Thanks,
Danny

Make sure you install "Microsoft SQL Server 2005 Analysis Services 9.0 OLE DB Provider " on you client machine

You can get it from http://www.microsoft.com/downloads/details.aspx?familyid=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||I think this gets installed with SQL 2005 locally but I reinstalled it. Unfortunately this had no impact and the error message is the same.|||

Take a look at this post: http://www.sqljunkies.com/WebLog/edwardm/archive/2006/05/26/21447.aspx

In addition: Another way to test connectivity:

1. Create new empty text file.
2. Change it's extension to .udl
3. Double click on the file, and in the "Data Link Properties" dialog go to the "Provider" tab. Select there "Microsoft OLE DB Provider for Analysis Services 9.0" then "Next".
4 On the connection page type name of your server and select "Use Windows NT integrated security"

At this point you should be able to list of databases on Analysis Server.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||Thanks Edward. It succeeded on the Test connection and the initial catalog select list populated with the SSAS database names. Looks like the server is responding and the OLE DB driver for AS 9.0 is working. That narrows the issue down to MSExcel 2003 and/or the Addin.|||Issue somehow resolved itself after perfroming a repair on Excel following by reregistering the OLEDB 9.0 dll.

Can not connect to AS 2005 from Excel

I'm having issues connecting to AS 2005 sp1 from Excel 2003. I have tried
two configurations as follows:

Secario 1
Installed on a Windows Server 2003 is AS 2005 sp1.
Installed on a workstation with XP sp2 is Office 2003, msxml parser 6.0, SQL
Server AS ADOMD, Excel Add-in for SQL Server Analysis Services sp1.

Secario 2
Installed all on workstation with XP sp2: Full install of SQL Server 2005
Dev Edition, Office 2003, msxml parser 6.0, SQL Server AS ADOMD, Excel
Add-in for SQL Server Analysis Services sp1.

In both cases the error returned is server does not exist or is too busy.

The cube is created and can be browsed from BI Studio.
The LAN id has been added to the AS 2005 security.
All SQL Services are started including Browser and AS.
Firewalls are not enabled.
Local and remote clients are allowed to connect to AS.
I can open TCP port 2383 with telnet on the AS server from the workstation.

Any one see anything I've missed or can shed some light on why the server is
not allowing connections?

Thanks,
Danny

Make sure you install "Microsoft SQL Server 2005 Analysis Services 9.0 OLE DB Provider " on you client machine

You can get it from http://www.microsoft.com/downloads/details.aspx?familyid=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||I think this gets installed with SQL 2005 locally but I reinstalled it. Unfortunately this had no impact and the error message is the same.|||

Take a look at this post: http://www.sqljunkies.com/WebLog/edwardm/archive/2006/05/26/21447.aspx

In addition: Another way to test connectivity:

1. Create new empty text file.
2. Change it's extension to .udl
3. Double click on the file, and in the "Data Link Properties" dialog go to the "Provider" tab. Select there "Microsoft OLE DB Provider for Analysis Services 9.0" then "Next".
4 On the connection page type name of your server and select "Use Windows NT integrated security"

At this point you should be able to list of databases on Analysis Server.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||Thanks Edward. It succeeded on the Test connection and the initial catalog select list populated with the SSAS database names. Looks like the server is responding and the OLE DB driver for AS 9.0 is working. That narrows the issue down to MSExcel 2003 and/or the Addin.|||Issue somehow resolved itself after perfroming a repair on Excel following by reregistering the OLEDB 9.0 dll.sql

Tuesday, March 20, 2012

Can not access Excel file using OpenRowset

I am using SQLServer 2005 SP2. I enabled the Ad Hoc Distributed Queries and DisallowAdhocAccess registry option is explicitly set to 0. Query is working fine when I remote desk to the server and execute when I run same query from my workstation I am getting following error

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.

Msg 7303, Level 16, State 1, Line 1

Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

Any help is appreciated.

Thanks

--

Farhan

Can you post the text of your query?|||

Here you go ...

Select * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',

'Data Source=C:\inventory.xls;Extended Properties=Excel 8.0')...[Laptop$]

|||Can we clarify your original statement?
You wrote that when you execute the statement from the server itself it works.
In that case how do you exactly execute the query? And how do you do it from your workstation?|||

Hello Anton,

I ran the query using SQLServer Management Studio both on Server and Workstation.

Thanks.

|||Connecting to the same server with the same credentials?|||

I think this is a point of view issue. Remember that when you perform OpenRowset, it is looking for that location from the server's point of view. If you create a file on the client at C:\file and try to link to it from the server, it will naturally not find C:\file. You have to specify where the server would find that file, not where it is on the client. This is the same kind of issue that would come up if you try to load a CLR assembly on the server that is built on the client. The file is not within the scope of the server's view and definitely not in the same place so it fails to find it and fails to load, but if you perform the exact same operation on the server, it succeeds. This is because, when performing this operation on the server, the client and server are the same machine and have the same filesystem view. You can work around this issue in a few ways if you need to dynamically link the server to a client file. I suggest either: 1.) upload the file through TCP or an extended stored procedure and link to it from the directory path in the server's view, 2.) create a share and place files on the share that you want to push over to the server, specifying the share should give you a uniform location across client and server and effectively abstract out this detail.

Hope that helps,

John

sql

Can not access Excel file using OpenRowset

I am using SQLServer 2005 SP2. I enabled the Ad Hoc Distributed Queries and DisallowAdhocAccess registry option is explicitly set to 0. Query is working fine when I remote desk to the server and execute when I run same query from my workstation I am getting following error

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.

Msg 7303, Level 16, State 1, Line 1

Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

Any help is appreciated.

Thanks

--

Farhan

Can you post the text of your query?|||

Here you go ...

Select * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',

'Data Source=C:\inventory.xls;Extended Properties=Excel 8.0')...[Laptop$]

|||Can we clarify your original statement?
You wrote that when you execute the statement from the server itself it works.
In that case how do you exactly execute the query? And how do you do it from your workstation?|||

Hello Anton,

I ran the query using SQLServer Management Studio both on Server and Workstation.

Thanks.

|||Connecting to the same server with the same credentials?|||

I think this is a point of view issue. Remember that when you perform OpenRowset, it is looking for that location from the server's point of view. If you create a file on the client at C:\file and try to link to it from the server, it will naturally not find C:\file. You have to specify where the server would find that file, not where it is on the client. This is the same kind of issue that would come up if you try to load a CLR assembly on the server that is built on the client. The file is not within the scope of the server's view and definitely not in the same place so it fails to find it and fails to load, but if you perform the exact same operation on the server, it succeeds. This is because, when performing this operation on the server, the client and server are the same machine and have the same filesystem view. You can work around this issue in a few ways if you need to dynamically link the server to a client file. I suggest either: 1.) upload the file through TCP or an extended stored procedure and link to it from the directory path in the server's view, 2.) create a share and place files on the share that you want to push over to the server, specifying the share should give you a uniform location across client and server and effectively abstract out this detail.

Hope that helps,

John

Can not access Excel file using OpenRowset

I am using SQLServer 2005 SP2. I enabled the Ad Hoc Distributed Queries and DisallowAdhocAccess registry option is explicitly set to 0. Query is working fine when I remote desk to the server and execute when I run same query from my workstation I am getting following error

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.

Msg 7303, Level 16, State 1, Line 1

Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

Any help is appreciated.

Thanks

--

Farhan

Can you post the text of your query?|||

Here you go ...

Select * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',

'Data Source=C:\inventory.xls;Extended Properties=Excel 8.0')...[Laptop$]

|||Can we clarify your original statement?
You wrote that when you execute the statement from the server itself it works.
In that case how do you exactly execute the query? And how do you do it from your workstation?|||

Hello Anton,

I ran the query using SQLServer Management Studio both on Server and Workstation.

Thanks.

|||Connecting to the same server with the same credentials?|||

I think this is a point of view issue. Remember that when you perform OpenRowset, it is looking for that location from the server's point of view. If you create a file on the client at C:\file and try to link to it from the server, it will naturally not find C:\file. You have to specify where the server would find that file, not where it is on the client. This is the same kind of issue that would come up if you try to load a CLR assembly on the server that is built on the client. The file is not within the scope of the server's view and definitely not in the same place so it fails to find it and fails to load, but if you perform the exact same operation on the server, it succeeds. This is because, when performing this operation on the server, the client and server are the same machine and have the same filesystem view. You can work around this issue in a few ways if you need to dynamically link the server to a client file. I suggest either: 1.) upload the file through TCP or an extended stored procedure and link to it from the directory path in the server's view, 2.) create a share and place files on the share that you want to push over to the server, specifying the share should give you a uniform location across client and server and effectively abstract out this detail.

Hope that helps,

John

Friday, February 24, 2012

Can I store a file in a SQL Server Database?

I have SQL Server 2000 and I have to make a table for storing Word, Excel or maybe some other Microsoft Office files. What data type should I use for this? Can I search through the stored files by words in a stored documents using a query and how?
Also the database where this table is created should provide similar functionality as a file server open, edit, check in, and check out on stored files. Can I do this in SQL Server 2000?As fare as I know, SQL Server has no specific support for office files.

So, you have the choice between re-inventing the functionality of document information systems, or to buy some. These systems are storing office files as BLOBs to keep all controls, and they are storing the text in a separate TEXT field to enable searching.

However, there is a third way: store only the path to the documents on your netwerk, and use Office's functionality to prevent users to open the same document twice.

Can I store a file in a SQL Server Database?

I have SQL Server 2000 and I have to make a table for storing Word, Excel or maybe some other Microsoft Office files. What data type should I use for this? Can I search through the stored files by words in a stored documents using a query and how?
Also the database where this table is created should provide similar functionality as a file server open, edit, check in, and check out on stored files. Can I do this in SQL Server 2000?You can store documents in the text or image data type.

You probably can't search on them, but your could store a summary in a character-based field with the record, or a column that just contains keywords.

Yes, you can provide functionality similar to a file-server...you just have to write it all yourself. :(

I can tell you that you are looking at a daunting project here that will likely involve complex coding. The user-interface will probably also prove difficult.

Perhaps somebody else on the forum will see this post and could recommend some professionally designed 3rd party software for document management?

blindman

Can I start Excel on a PC using a Stored Procedure?

Is there any way to have a job in SQL Server start Excel on a PC?
Thanks in advance,
RaulExcel is a desktop application. You cannot start applications that require
a GUI component from SQL Server... SQL Server Agent will hang.
What exactly are you trying to accomplish?
"Raul" <raul@.nothere.com> wrote in message
news:62AA65E5-C7A4-4B81-9BFC-5A1AC579BE42@.microsoft.com...
> Is there any way to have a job in SQL Server start Excel on a PC?
> Thanks in advance,
> Raul|||You could create a scheduled task on your PC, called Task1, which launches
Excel.
From the SQL server,
xp_cmdshell 'schtasks /run /tn Task1 /s NAMEOFPC'
In order for this to work the SQL server process must be running as a user
that has administrative authority on the PC on which you want to start Excel
.
(Starting a scheduled task remotely requires administrator priveledge). If i
t
is running under the local system account, you could specify a username and
password in the schtasks command:
xp_cmdshell 'schtasks /run /tn Task1 /s NAMEOFPC /u username /p password'
This way would put the password for an (administrative) account in plain
text somewhere, so it is not very secure.
"Raul" wrote:

> Is there any way to have a job in SQL Server start Excel on a PC?
> Thanks in advance,
> Raul|||I want a stored procedure, that is run as a scheduled job in SQL Server
Agent, to return the results of a query to a specific Excel workbook. Once
the data is inserted in the workbook, I would like to run a VBA routine in
the workbook to carry out a number of tasks.
I can write the results of the query in Excel using a linked server to the
desired spreadsheet, but I like to be able to fire off the routine to perfor
m
a number of desired tasks after the data has been inserted.
Raul
"Aaron Bertrand [SQL Server MVP]" wrote:

> Excel is a desktop application. You cannot start applications that requir
e
> a GUI component from SQL Server... SQL Server Agent will hang.
> What exactly are you trying to accomplish?
>
>
>
> "Raul" <raul@.nothere.com> wrote in message
> news:62AA65E5-C7A4-4B81-9BFC-5A1AC579BE42@.microsoft.com...
>
>|||Thanks a bunch! The biggest problem may be getting the IT folks to give me
administrator privileges on the server. I guess the other option is to add
a
new administrator account on my PC.
Thanks again,
Raul
"Mark Williams" wrote:
> You could create a scheduled task on your PC, called Task1, which launches
> Excel.
> From the SQL server,
> xp_cmdshell 'schtasks /run /tn Task1 /s NAMEOFPC'
> In order for this to work the SQL server process must be running as a user
> that has administrative authority on the PC on which you want to start Exc
el.
> (Starting a scheduled task remotely requires administrator priveledge). If
it
> is running under the local system account, you could specify a username an
d
> password in the schtasks command:
> xp_cmdshell 'schtasks /run /tn Task1 /s NAMEOFPC /u username /p password'
> This way would put the password for an (administrative) account in plain
> text somewhere, so it is not very secure.
> --
> "Raul" wrote:
>

Sunday, February 19, 2012

Can I set Excel connection manager's data source as a variable?

I do not know the Excel file name to load in design time.

Would like to pass the value to a variable in the package in run time?

How to do this?

Thanks,

Guangming

Property Expressions is the feature you want. You can assign and expression to most properties, including the DataSource property of a connection. The expression would just be the name of your variable, e.g.

@.[User:MyVar]

Some UIs expose expressions as a separate tab, or just expand expressions from the normal properties grid.

|||I set ExcelFilePath to a variable:

varExcelFileFullPath.

I set an initial value ( \\test\testShare\aaab.xls ) to it when designing the package. It works

Later I run it inside SQL server as below. It failed.

exec xp_cmdshell 'dtexec /SQL "\NE_LoadExcel_Test_direct" /SERVER ** /USER ***** /PASSWORD ****

/CONNECTION "DataSource-Excel";"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\test\testshare\aaab2.xls;Extended Properties=""EXCEL 8.0;HDR=YES"";"

/CONNECTION "Test.NGAEarth";"Data Source=Test;Initial Catalog=NGAEarth;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;"

/MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING EW /LOGGER "{6AA833A1-E4B2-4431-831B-DE695049DC61}";"Test.NGAEarth"

/set "\Package.Variables[User::varPreSQLAction].Properties[Value]";"delete from Features where type = ''aaab''"

/set "\Package.Variables[User::varExcelWorkbookName].Properties[Value]";"Sheet1$"

/set "\Package.Variables[User::varDestinationTableName].Properties[Value]";"Features"

/set "\Package.Variables[User::varExcelFileFullPath].Properties[Value]";"\\test\testShare\aaab2.xls"

'

Actually, I tried to change other variables. E.g., I changed the file name from aaab2.xls to aaab.xls, Excel worksheet name from Sheet1$ to Sheet2$.

It seems the package never get the parameters I set as above. It always gets the values I set in design time. The errors I got are:

Error: 2006-02-01 15:54:23.58

Code: 0xC0202009

Source: Extract AdHoc Data from Excel Excel Source [649]

Description: An OLE DB error has occurred. Error code: 0x80040E37.

End Error

Error: 2006-02-01 15:54:23.58

Code: 0xC02020E8

Source: Extract AdHoc Data from Excel Excel Source [649]

Description: Opening a rowset for "Sheet1$" failed. Check that the object exists in the database.

End Error

Error: 2006-02-01 15:54:23.58

Code: 0xC004706B

Source: Extract AdHoc Data from Excel DTS.Pipeline

Description: "component "Excel Source" (649)" failed validation and returned validation status "VS_ISBROKEN".

End Error

|||

Finally I found the problem:

The way to put the command string is not right after dtexec /SQL.

If there is not ENTER and all commands in one line (as it is a dos command), everything is OK!

Is it COOL!?

Guangming