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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP & MySQL

Status
Not open for further replies.

ChrisHasenpflug

Programmer
Nov 15, 2001
7
US
I'm having problems accessing the mySQL database via ASP. IIS and mySQL are running on the same machine. The error message I get is:
Code:
Microsoft OLE DB Provider for ODBC Drivers error '80004005' 

[TCX][MyODBC]Can't create TCP/IP socket (10093) 

/mysql/connection.asp, line 4

The connection.asp script reads as follows:
Code:
<!--#include file=&quot;adovbs.inc&quot;-->
<% 
Set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Conn.Open = &quot;driver={MySQL};server=localhost;uid=root;pwd=password;database=Trading&quot; 
%>

I have also tried using a DSN connection and recieve the same error message

Everywhere I look on the internet I can't seem to get anything to work.
Does anyone have a suggestion for me to try??
 
When you tried a DSN did the connection work through the ODBC Administration area ??
If so what was the code you tried in the ASP ?
 
How would I test it?? I set it up and everything, but how do I test the connection?? I don't have Access installed on my server, just server apps.
 
I assumed u are using SQL as mySql was name but with Access you need to specify an Access driver..

try..

Conn.Open &quot;driver={Microsoft Access Driver (*.mdb)};
server=localhost;uid=root;pwd=password;database=Trading&quot;

or maybe
Conn.Open &quot;driver={Microsoft Access};
server=localhost;uid=root;pwd=password;database=Trading&quot;
 
Andrew maybe I was vague. I am indeed running mySQL. I was saying I do not have Access on my server PC in order to test the DNS connection. I configured it correctly I believe but recieved the same error message in the ASP script when I tried connecting to it via DNS. Is there another way I can test the DNS connection?
 
Where you setup up your DSN in the ODBC Data Source Administrator via control panel there is a button to test the connection
Make sure your DSN is a System and not a User DSN

Assuming you call your DSN &quot;mySQL&quot; then once the connection is verified try...

Conn.Open &quot;DSN=mySQL;uid=root;pwd=password;&quot;


 
Sorry just read that you get the error using the DSN test button...
Have you tried switching the Client Configuration to use Named Pipes instead of TCP/IP ?
 
The DSN setup for the MySQL driver does not give the test button, the screen is dramatically different for it then other ODBC drivers. Am I missing something??

New connection.asp is
Code:
<%@ LANGUAGE=&quot;VBSCRIPT&quot; %>
<%
Set MyConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
MyConn.Open &quot;DSN=TradingASP;uid=root;pwd=password;&quot;
%>

And still get the error message posted before.
 
OK so I reinstalled mySQL and the pages started working. That was last night. Today I get the message again. What's going on, any idea??
 
Sounds like DLL hell to me ?
What versions of operating system, IIS and ODBC have you installed and have you installed patches for these ?

Another thing to try would be to create a small app (in VB or whatever) that connects to the DSN and see if this works ok.
If it does then I suspect the problem is with your IIS install. I have ended up with annoying intermittent problems like this sometimes where the only fix was to completely reinstall IIS and patch it up.
 
Windows 2000 Advanced Server with all patches and SRs.
IIS is all patched up.
The ODBC driver is from the mySQL site, I downloaded it just the other day.

Sounds like I'm reinstalling AS this weekend along with upgrading my desktop machine :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top