Solved

Retrieving data to .asp page via MySQL...

Posted on 2004-08-24
3
170 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now