Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL Server vs. MSDE

Author  Topic 

SunnyDee
Yak Posting Veteran

79 Posts

Posted - 2007-02-15 : 17:51:26
Quick question....

consider this code

Dim oConn As New ADODB.Connection
With oConn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Extended Properties").Value = "Excel 8.0"
.Open "C:\Book1.xls"
'....
.Close
End With


If the data source specifices the local msde in the connection string, is c:\book1.xls on the user's hard drive?

If the data source specifies the sql server name in the connection string, where does it think c:\book1.xls resides? On the user's hard drive who is running the code, or on the server?

Thanks for any help.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-02-15 : 17:55:18
That is application code, so whereever the code is running is where that file will exist. This has nothing to do with SQL Server or MSDE.

Tara Kizer
Go to Top of Page

SunnyDee
Yak Posting Veteran

79 Posts

Posted - 2007-02-15 : 18:09:56
Thanks for your response. I'm really puzzled because the code works locally, but doesn't work when the server name is in the connection string. The message received is:

"2147217900 - OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEdB.4.0' IDBInitialize:: Initialize returned 0x800040005: The provider did not give any information about the error.]" is the error message.

This message is pretty generic and doesn't tell me much.

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-02-15 : 18:24:48
Why are you reusing the connection properties? If you want the file to be on the client, why aren't you setting up a new connection for it?

Have you tried placing the file out of the database server to see if it works?

Tara Kizer
Go to Top of Page

SunnyDee
Yak Posting Veteran

79 Posts

Posted - 2007-02-15 : 18:31:23
Sorry if I wasn't clear, I do have two connections based on what the user selected. When user selects local instance, code works fine.

So are you saying I should try to copy the file up to the server to see if that works when user selects server database?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-02-15 : 19:01:59
Of course you should try it! I'm not saying that it will work, but maybe it will. It's hard to know what's going on since I'm a SQL Server DBA and this question is not SQL Server related.

Tara Kizer
Go to Top of Page

SunnyDee
Yak Posting Veteran

79 Posts

Posted - 2007-02-16 : 10:06:31
For the benefit of anyone else having this issue, the file does apparently need to be on the server.

I assumed this was a sql server issue since the code was blowing up at the point of connecting to SQL Server.
Kindly advise where I should be post this type of question in the future.
Go to Top of Page
   

- Advertisement -