Learn how to Install MySQL, import an Access database into MySQL database, and display data on a ASP page. Step by step tutorial with screenshots! Please leave questions or comments.. Updates: I have included a dsn-less connection!
Terms of Agreement:
By using this article, you agree to the following terms...
You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
You may link to this article from another website, but ONLY if it is not wrapped in a frame.
You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
Using
a MySql database in ASP is pretty simple, but it's hard to come accross
a straight forward tutorial on ASP & MySQL. So here it is, a mysql tutorial
for you.. Enjoy!
Right
click root@localhost and click create new database.
Name the
new database tutorialdb
Page
2 - MySQL Database
9.
Entering data into the database can be done several ways, manualy in MySQL-Front
or by Importing from another database. Here we are going to import this
database: Download
database
10.
Im-/Export > ODBC Import
11.
Check the MS Access File radio button then tables will load in the table
list box below, select the tables you want to important and then click import.
12.
Now you can view the table and its data.
Page
3 - MySQL Database
13.
Now we need to create a dsn connection this really easy and takes about
3 minutes at most.
NEW!
> DSN-LESS connnection:
Ok
here it is, people have been asking for how to connect to MySQL without
a dsn.
The tutorial was great but I'm confused about one thing. In step 13 you say to create a DSN-less connection then you go on to create a DSN and use it in the asp script. Did I miss something or is that a typo? BTW.. I am currently using a mysql database on a web server without a dsn in case you need information on doing that. (If this comment was disrespectful, please report it.)
You are correct, that is a typo thanks! And yes I would like to know how to connect without a dsn, was trying to figure that out.. - thanks and thanks for the globes everyone. (If this comment was disrespectful, please report it.)
Yes, I like the visual approach myself, I knew there needed to be a "different" way to teach in a tutorial, because all the other tutorials, were not cutting it. ;)
Hey Ed, as soon as I get the dsn-less connection working I will post it, but for now its not working for some reason.
- Jason
Thanks everyone! (If this comment was disrespectful, please report it.)
I just want to say one thing EXCELLENT TUTORIAL AND THANKS FOR SHARING IT. Also you have a well done site. Nice Nice Job. Jose "foxsermon" :0) (If this comment was disrespectful, please report it.)
Just to be picky because I'm mean. ;) Its good habit to clear the RS object as it is where all the records are actually stored. 5 Globes from me. (If this comment was disrespectful, please report it.)
what versions are u using? my screens look completely diff - plus it doesn't work with either DSN or no DSN (If this comment was disrespectful, please report it.)
Yeh, very smart designed turtorials on your homepage. Also asp-dll tutor an more there is importent for many. Thank you very match. (If this comment was disrespectful, please report it.)
Excellent tutorial! Just what my new project was needing. You said the DSN-less version was available . . . is that on PSC or your site? (If this comment was disrespectful, please report it.)
Thanks, but it says that full outer join is not supported yet: http://www.mysql.com/doc/en/TODO_sometime.html (If this comment was disrespectful, please report it.)
Cool work. Do you want to make money with your programming skills ? Software Objects provide following services : 1)Sell your software. 2)Post a software to be done. 3)Bid on the software projects. 4)Buy software Thanks and have a nice day. Software Objects http://www.thesoftwareobjects.com
(If this comment was disrespectful, please report it.)
3/4/2003 9:54:40 PM:
Hi.. i know i'm being silly but i'm totally clueless about mysql, etc and i'm currently doing a project on it! here's my silly question, where do i type the asp codes in? i've got all my tables running and my only problem is, i dont know how to link mysql to my website! anyway, where do i insert the asp codes? thanks! Great Job btw! (If this comment was disrespectful, please report it.)
3/5/2003 7:26:58 PM:
i posted the previous comment.... don't worry bout it! i figured it out already! :) Have a great day! (If this comment was disrespectful, please report it.)
7/8/2003 9:30:49 AM:
Can somebody tell me how to connect my web MySQL database with ASP without using ODBC neither MyODBC. Thanks (If this comment was disrespectful, please report it.)
8/28/2003 9:20:59 AM:
Just great information. Thanks! I have a question to step 5. I can´t stop the MySQL server. Where do I find the Start/Stop commands? (If this comment was disrespectful, please report it.)
To stop mysql server you can goto Control Panel > Adminstrator tools > Services > And stop mysql in by selecting it and right click > properties > stop. (If this comment was disrespectful, please report it.)
10/22/2003 12:45:41 AM:
Excellent Guide although there is one misstake in the DSN-less part.
Set rs = conn.Execute(strSQL) should be Set rs = my_conn.Execute(strSQL)
(If this comment was disrespectful, please report it.)
10/23/2003 11:28:32 PM:
Cái này quản lư MySQL hả ta ?? (If this comment was disrespectful, please report it.)
the pages links dont work, pls make them work, what i need to learn are things on how to connect to MySQL using ASP... (If this comment was disrespectful, please report it.)
Add Your Feedback
Your feedback will be posted below and an email sent to
the author. Please remember that the author was kind enough to
share this with you, so any criticisms must be stated politely, or they
will be deleted. (For feedback not related to this particular article, please
click here instead.)