473,569 Members | 2,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

First time using ASP to connect to remote MySQL database

25 New Member
Hi, I'm a PHP developer and i've been asked to do some development for a site which is on a web server which only supports ASP. I had planned to have a bash at writing an ASP program (first time) on this server which will interact with a MySQL database on another web server (my company's web space). Would this be possible?
Sep 20 '07 #1
2 4584
JamieHowarth0
533 Recognized Expert Contributor
Hi Nicky,

ASP is definitely interoperable with MySQL - check out my website at www.cmdev-associates.com, uses MySQL 5 Community Edition with ASP and AJAX!

You need the ODBC connector from MySQL (version 3.51 is the latest, from http://dev.mysql.com/downloads/connector/odbc/3.51.html) and get it installed on the server where your ASP pages reside

You then need the following code:

Expand|Select|Wrap|Line Numbers
  1. Set objDbConn = Server.CreateObject("ADODB.Connection")
  2. strConn = "Driver={MySQL 3.51 ODBC Driver};Server=yourmysqlserveraddress.com;Database=yourDB;"
  3. objDbConn.CursorLocation = adUseClient
  4. objDbConn.Open strConn
  5.  
Simple as that!

All the best,

medicineworker
Sep 21 '07 #2
mylo1968
8 New Member
Here:

http://www.devarticles .com/c/a/MySQL/Two-Lessons-in-ASP-and-MySQL/

... is something to be taken into account with ASP/Vbscript and MySQL concerning date data type differences,

Regards,

Matti


Hi, I'm a PHP developer and i've been asked to do some development for a site which is on a web server which only supports ASP. I had planned to have a bash at writing an ASP program (first time) on this server which will interact with a MySQL database on another web server (my company's web space). Would this be possible?
Sep 25 '07 #3

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

Similar topics

16
2878
by: John | last post by:
Hello. If I want to set up my first database and start using it in Dreamweaver what do I need to do? The book I'm working on has a CD with the database on. It is telling me to put it in the MySql folder on drive C. However, when I'm in Dreamweaver I click on Applications at the side, and the plus button to add a MySql database. It...
0
2438
by: Campbell's List | last post by:
Hi, I'm completely new to MySql and need help importing tables from Access or Dbase. I am using Dreamweaver MX to create a data-driven web site. With the VPS hosting plan we're on, our remote FreeBSD server only supports the PHP application server. PHP requires MySql. Thus, I installed a copy of MySQL Control Center 0.9.2 beta. (I prefer a...
2
1678
by: Daven Thrice | last post by:
Hi, I've converted the tables from an old Access application to MySql format. I then linked the tables into access using MyODBC and everything works great (on my computer). For now, I want to keep Access as a front end, and move the tables to the Internet. I feel like I'm lost in a maze or something with some really basic questions. What...
4
6449
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to define the servername / hostname in my Perl Progrem.. Here is the code:
5
3838
by: Ike | last post by:
Through Java, I am attempting to connect to a MySQL 4.12 server on a remote computer. I can connect fine via php. I cann connect fine via Java, through a servlet, when the servlet is on the same machine (localhost) as the MySQL DB. However, when they are on different machines with different IPs, calling across the Internet (and there are no...
4
2664
by: courtney.machi | last post by:
Hello, I am trying to connect to a remote mysql server through php. Here's the code: mysql_connect("my.hostname.edu", "username", "password") or die (mysql_error()); mysql_select_db("db_name") or die ("unable to select db".mysql_error()); $r1 = mysql_query('SELECT * FROM table') ;
3
10415
by: shawzozo | last post by:
obviously I am doing something wrong when I try to connect to my db. Please help the code I am using is something like this: <?php function connect_db() { global $link; $host = 'server.root.com'; (Ps: Note I am not using www.server.root.com) $user = 'username'; $pass = 'password'; $dbname = 'database';
2
22531
by: Martin | last post by:
Hi all. I have a fully functional page hosted on my PC that uses PHP and connects to MySQL on my PC to generate it's code. I now have some web hosting available which includes both PHP and MySQL support, however the webhost is still in the process of getting the MySQL support activated and functional. I therefore have uploaded my...
5
7679
by: msch-prv | last post by:
Hi, I am trying to tie a SQLDataSource control to MySQL without success. The connection string works ok with an ObjectDataSource. (Native asp.net 2.0 MySQL dll loaded in /bin) For some reason, the compiler believes an SQL db is being accessed ("An error has occurred while establishing a connection to the server. When connecting to SQL...
0
7698
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...
1
7673
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...
0
7970
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
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
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
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.