Solved

Retrieving data to .asp page via MySQL...

Posted on 2004-08-24
3
173 Views
Last Modified: 2010-04-19
Hi,

I have installed MySQL V4.0.20a-MAX.
I have created the following .asp web page, which is located in the usual wwwroot folder, to pull data from the local MySQL db, but all the page does is sit there trying load the page, but nothing ever appears.
I know 100% the asp service is working, because if I run a test page....the text displays. I have looked at every setting I can think of ?

Here is my .asp page trying to connect to the db.

<html>
<body>

<%

strConnection = "driver={MySQL};server=xx.xxx.xx.x;uid=blah;pwd=blah;database=blah"
Set adoDataConn = Server.CreateObject("ADODB.Connection")
adoDataConn.Open strConnection


strQuery = "SELECT Customers.CustomerName FROM Customers;"

Set RS = adoDataConn.Execute(strQuery)

If RS.eof then

response.write "Boo Hoo"

else

Do until RS.eof

response.write RS("CustomerName") & "<br>"

RS.Movenext

Loop

End IF

%>

</Body>
</html>

_________________

Are there any special setting for data retrieval in Windows Server 2003 that I have not tried ?
This code works perfectly when the connection string points to Our MySQL db hosted on our Linux server, but it does not work on the Windows Server ?
No errors, the page just never loads................

Thanks

David


0
Comment
Question by:scene
  • 2
3 Comments
 
LVL 7

Expert Comment

by:j2nku
ID: 11880763
Have you tried with ODBC connection? There should be MySQL connection and then you can just use connection string "DSN=MyMySQLConnection"
MySQL ODBC drivers should be available here: http://dev.mysql.com/downloads/connector/odbc/3.52.html

I have MySQL on Win2k3 also running, but it's used only by PHP scripts.
0
 

Author Comment

by:scene
ID: 11881405
I have tried everything.
I can see no problem why Windows MySQL should not work with .asp pages ?
I have tried via a DSN.

Either the page just spends ages trying to load, or it just says it cannot find the page etc...
The problem is definately down to the connection string. Is there anything in Windows 2003 Server that could cause this connection problem ?
I've tested an ODBC connection in the ODBC panel, and it connects no problem ?

Still confused ?

David
0
 
LVL 7

Accepted Solution

by:
j2nku earned 125 total points
ID: 11893314
Try to connect not only to IP but also to server name

I had once 2 SQL server instances on a single machine and the thing didn't work before i connected to DBSERV\LOCAL, because DBSERV was a SQL server that was configured not to accept connections.

Of course it applies to MS SQL and i'm not sure about MySQL.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question