473,569 Members | 2,481 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 2034
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
6480
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 cannot connect to the remote db from web server box (linux) to mysql database (another linux box). Apache is on RH Enterprise 3.0, mysql is on slacware...
0
2399
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 there's going to be a learning curve, that having been said... I followed the install instructions at http://entropy.ch , and was able to get mySql &...
3
17790
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 server through socket /var/lib/mysql/mysql.sock On the website of MySQL this error is mentioned but I found no solution. In /var/log/messages the...
2
2894
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) and type "mysql", I get this error: Can't connect to local MySQL server through socket '/home/data/mysql/mysql.sock' (13) Any idea why?...
1
121518
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 alpha) so I deinstall mysql5-server and mysql5-client And then I install mysql41-server and mysql41-client on FreeBSD 5.3 by ports but now , mysql is...
16
27880
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 own LAN, the driver tells me it cannot make the connection. Here are the ODBC driver connection parms: Data Source Name: (free field - name my "my...
1
4492
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 servers are Fedora 4 with latests updates). The one that worked fine it down and I cannot compare anything against it (it was a client also). ...
1
2183
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 the remote database via ODBC via my homePC. I use MS Access (linked tables) on my PC, just because it's very easy to make new reports / forms /...
4
3755
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 working fine until today. I am trying to implement some ajax with the javascript framework mootools (although I don't see how this is causing the problem...
8
2821
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 put into stand-by or hibernation 3. later, computer is brought out of stand-by or hibernation 4. when trying to save or close form, SQL exception...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7678
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5222
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.