Error from ADO connection string to SQL Server 2008
have ado connection string works fine sql server 2000/2005 not work sql server 2008 provider=sqloledb. has provider changed in sql server 2008?
strconnect = "server=" & strserver _
& ";user id=" & struserid _
& ";pwd=" & strpassword _
& ";database=" & strdatabase _
& ";provider=sqloledb"
thanks,
hello laral,
you know ado can connect sql server 2 kinds of oledb provider. 1 sqloledb , other msdasql. have different connection string. connection string is msdasql.
if want connect sqlserver sqloledb, please try connection string below syntax.
oconn.open "provider=sqloledb;" & _
"data source=myservername;" & _
"initial catalog=mydatabasename;" & _
"user id=myusername;" & _
"password=mypassword"
SQL Server > SQL Server Data Access
Comments
Post a Comment