SQL and DSN-Less connection

S

shank

I've used the below DSN-Less template for a remote SQL DB, but having issues
trying to get it work on my local computer. Any idea what the values should
be? I get this error...

Error Type:
Provider (0x80040E21)
Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done.

<%
Set MM_GenKSQL_STRING = Server.CreateObject("ADODB.Connection")
MM_GenKSQL_STRING.Provider = "sqloledb"
MM_GenKSQL_STRING.Properties("Data Source").Value = "local" 'I've tried
local and also my computer name
MM_GenKSQL_STRING.Properties("Network Library").Value = "local" 'I've
tried local and also my computer name
MM_GenKSQL_STRING.Properties("Initial Catalog").Value = "GenK" 'I know
this is correct
MM_GenKSQL_STRING.Properties("User ID").Value = "" 'connecting
locally - don't need a username
MM_GenKSQL_STRING.Properties("Password").Value = "" 'connecting
locally - don't need a password
MM_GenKSQL_STRING.open
%>
 
A

Aaron [SQL Server MVP]

<%
Set MM_GenKSQL_STRING = Server.CreateObject("ADODB.Connection")
MM_GenKSQL_STRING.Provider = "sqloledb"
MM_GenKSQL_STRING.Properties("Data Source").Value = "local" 'I've tried
local and also my computer name
MM_GenKSQL_STRING.Properties("Network Library").Value = "local" 'I've
tried local and also my computer name
MM_GenKSQL_STRING.Properties("Initial Catalog").Value = "GenK" 'I know
this is correct
MM_GenKSQL_STRING.Properties("User ID").Value = "" 'connecting
locally - don't need a username
MM_GenKSQL_STRING.Properties("Password").Value = "" 'connecting
locally - don't need a password
MM_GenKSQL_STRING.open
%>

Ugh, what is all this? STOP USING WYSIWYG CRAP TO PRODUCE ASP CODE.
http://www.aspfaq.com/2126

The server name should be "(local)" with the parens or "LOCALHOST" or
"127.0.0.1" or your IP address or your computer name. I don't know where
you got the idea to use "local"...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top