Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connection string

Status
Not open for further replies.

s4dadmin

Programmer
Apr 27, 2003
107
US
I have just installed mysql and I am getting an error with my connection string. Using W2K Pro. I have downloaded myodbc but I would like to use a dsn less connection.

In global.asa this is the code
Sub Application_OnStart
Application("DBCONN")="Driver={MySQL);SERVER=localhost;DATABASE=test;UID=cuexxx;PWD=xxxxxx;Extended Properties='OPTION=16387'"
Application("AllHits") = 0
End Sub

and in the page it is

Sey myConn = Server.CreateObject("ADODB.Connection")
myConn.open("Application("DBCONN"))

Here is the error

Error Type:
Microsoft OLE DB Service Components (0x80040E73)
Format of the initialization string does not conform to the OLE DB specification.
/includes/stat_track.asp, line 11
 
I had a similar problem. Have you tried changing the "localhost" to your ip address?
 
Sorry, I should have said

Have you tried changing "localhost" to the ip address of your mysql server?
 
Here is the correct string


if you want to use a DSN


<%
Set MyConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
MyConn.Open &quot;DSN_name&quot; , &quot;user&quot;, &quot;password&quot;
%>


if you want a DSNLess connection

<%
Set myConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
myConn.Open (&quot;Driver={MySQL}; SERVER=192.168.x.x; DATABASE=DBname; UID=username; PASSWORD=password&quot;)
%>


and forget about global.asa
You only need global file if you are planning on using InterDev connection features which I don't recommend.


Bye


Qatqat



The reason why my girlfriend can read my thoughts is because mine are properly written! (G.Lepore)
 
I tried using the I.P. address of mysql server instead of localhost, but it didn't work at first. I created a DSN and it worked fine. Now I will go back and try the DSNless connection QatQat. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top