yoelbenyossef
2009-02-02 21:22:19 UTC
I'm trying to connect adapt some code that I wrote for an access database to an sql server 2005 database. When I try to run the code now, I get this error:
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (ParseConnectParams()).]Invalid connection.
My connection string in access is:
dim cnn,rst
set cnn = Server.CreateObject("ADODB.Connection")
set rst = Server.CreateObject("ADODB.RecordSet")
cnn.Open "driver={Microsoft Access Driver (*.mdb)};;DBQ=c:\db\directory\directory.mdb;"
My connection string in SQL Server 2005 is:
dim cnn,rst
set cnn = Server.CreateObject("ADODB.Connection")
set rst = Server.CreateObject("ADODB.RecordSet")
cnn.ConnectionString = "Provider=SQLOLEDB;data source=d:\hosting\HostName; database=DBName.db;Uid=xxx;Pwd=xxx;"
Cnn.Open
If anyone could tell me what I'm doing wrong, or a tutorial on how to build connection strings, it would be much appreciated.
Thanks
Eric