473,508 Members | 2,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connect Remote ASP to Remote MySQL

3 New Member
In ASP I am using a DNS-less connection (see code below: with the log in credentials filtered).

Expand|Select|Wrap|Line Numbers
  1. <%
  2. on error resume next
  3.  
  4. dim csmp_conn
  5. dim adoRS
  6. dim counter
  7.  
  8. set csmp_conn = Server.CreateObject("ADODB.Connection")
  9. set adoRS = Server.CreateObject("ADODB.Recordset")
  10. csmp_conn.Open "Driver={MySQL ODBC 5.1 Driver}; Server=XXXXX; Database=XXXXX; Uid=XXXXX; Pwd=XXXXX;"
  11.  
  12. adoRS.ActiveConnection = csmp_conn
  13.  
  14.  
  15. response.write "<h2>Number of Records in MyTable: </h2>"
  16. adoRS.Open "SELECT * FROM myTable"
  17.  
  18. ' Count how many records exist
  19. dim iRecordCount
  20. iRecordCount = 0
  21. DO WHILE NOT adoRS.EOF
  22. iRecordCount = iRecordCount + 1
  23. adoRS.MoveNext
  24. Loop
  25.  
  26. ' Display result
  27. Response.Write "Record Count:(" & iRecordCount & ")"
  28.  
  29. adoRS.Close
  30. Set adoRS = Nothing     
  31.  
  32. %>
  33.  
Testing the connection string and executing the sample query works fine locally but the problem comes when I test the same file on my hosting site's server. It appears that the page is not getting access to the remote database by so doing it returns an error but I am not entirely sure why this is the case.

If anyone has ever come across this problem your input will be greatly appreciated.
Jan 23 '12 #1
2 2031
C CSR
144 New Member
What is the error message? Or does it just crash?
Jan 23 '12 #2
munro01
3 New Member
Hi sorry for the late response. I managed to find a solution to the problem. It was more of a system issue than the code itself.
Jan 27 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
6472
by: Eric W. Holzapfel | last post by:
Hello PHP group, I have mysql running on a linux box. I have apache (2.0.4) running on a diff linux box. I have php 4.X. I can connect to the mysql db using odbc from a windows box, but...
0
2395
by: Bill Hernandez | last post by:
Hi, I've been writing software on the mac since 1987, but am brand new at unix/php/mysql, and that's where I'm headed so I'm reading everything I can get my hands on, but like anything else...
3
17786
by: Pugi! | last post by:
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get the following problem when connecting to mysql through a browser (phpMyAdmin): : #2002 Can't connect to local MySQL...
2
2887
by: Brett B | last post by:
I just installed mysql on linux. If I open a terminal, su to root, then type "mysql", I am able to connect to the server and run my queries. If I exit out of su so that I am my own id (baisley)...
1
121506
by: jiing | last post by:
Now let me describe what I have done and my purpose: Originally, I want to user ports to install phpBB But I found that phpBB doesn't support mysql 5.x (but the ports installed mySQL 5.0.0...
16
27874
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
1
4487
by: linux | last post by:
Sorry if this is a really dumb question. I am trying to connect to our remote MySQL server (which is running just fine). I have a perl script which worked just fine on my other Fedora 4 box (all...
1
2162
by: JustMe | last post by:
Hi all, Although I've got quite a lot of experience with php and (M/My)SQL, I only used both within an online php script. These last few months I bought an option with my webhost to access...
4
3749
by: d3vkit | last post by:
Okay so I am at a loss here. I have a website that I've previously had no trouble connecting to the mysql DB on. I have an include to a connect file with the relevant connection info, and it was...
8
2820
by: BD | last post by:
I am developing C# win form app to work with remote database on SQL Server 2005. Problem scenario is as follows: 1. a form is open that has downloaded dataset to local cache 2. computer is...
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.