JIM.H. wrote:
Hello,
This is the code I created through udl and I get the following error.
Code:
Dim objDBConnect
Set objDBConnect = Server.CreateObject("ADODB.Connection")
objDBConnect.Open "Provider=MSDASQL.1;Persist Security
Info=False;User ID=sa;Data Source=OECCSQLWEB"
Error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][Named Pipes]SQL Server does not
exist or access denied.
Thanks,
Jim.
You chose the ODBC provider instead of the SQL Server provider when creating
your udl file. And then you selected a DSN form the list. Does this DSN
exist on the web server?
I suggest using OLEDB instead of the obsolet ODBC. Your connection string
should be:
objDBConnect.Open "Provider=SQLOLEDB.1;" & _
"Persist Security Info=False;" & _
"User ID=<some user other than sa>; " & _
"Password=<that user's password>;" & _
"Data Source=<the name of the server itself>"
See
www.able-consulting.com/ado_conn.htm for more examples of connection
strings
Don't use the sa account for applications. SA is god in your server! I
don't think you realize the havoc that can be caused by a hacker who manages
to log into your sql server under the sa account. Guard that account as if
your job depended on it - it probably does! Create a new sql login with only
the rights needed to do whatever needs to be done in the database. (You may
need to reconfigure SQL Server to use Mixed Authentication - see Books
Online)
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.