Solved

Retrieving data to .asp page via MySQL...

Posted on 2004-08-24
3
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

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.…
I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…

749 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