[SOLVED] Connecting/Using MySQL and ASP

This is a discussion on "[SOLVED] Connecting/Using MySQL and ASP" within the Classic ASP section. This forum, and the thread "[SOLVED] Connecting/Using MySQL and ASP are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Oct 9th, 2007, 02:38
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
[SOLVED] Connecting/Using MySQL and ASP

I don't know if this is a good idea, but at least I am migrating myself from the "not-popular" MS Access into MySQL
I have just install WAMP (windows apache mysql php) in my pc, but before go into php, i just want to know how to make asp interact with mysql.

Is anybody you out there that have been using ASP and MySQL before?
I would glad if you can teach me on the connection procedure, I mean what should I do in order to make my ASP page to interact with MySQL database.

Thanks...
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Last edited by Monie; Oct 9th, 2007 at 05:36.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Oct 9th, 2007, 10:25
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 36
Posts: 88
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Connecting/Using MySQL and ASP

Hi Monie, Try looking Here http://www.codeproject.com/database/...ings.asp#MySQL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 10th, 2007, 01:44
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Connecting/Using MySQL and ASP

Hai robbied,

Actually, I don't have problem with the connection string. I know how to use the WAMP tools and successfully create my first page that interact with my MySQL database. (display data from MySQL database)

My problem is, I wanted to learn how to do that not with php but with ASP. I search the net and I found out that you have to install some kind of odbc driver for mysql called MyODBC that you can download from www.mysql.com.

I have installed them and follow each instruction but couldn't manage to make my page interact with the MySQL database.

That's why I am asking if there is someone that design their page using asp and MySQL.
I wanted to know what are the thing's that I need to do for this asp-MySQL communication.

Thanks..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Last edited by Monie; Oct 10th, 2007 at 02:32.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 10th, 2007, 05:15
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Connecting/Using MySQL and ASP

I did it! I just could not believe it, I' done it!
Thats mean we dont have to install anything on our pc in order to make asp talk to MySQL, we just need the CONNECTION STRING that tell asp to find the MySQL.

Ok, now this code is just diaplays what are the field that I have in my table "contacts". What are the code for diplaying the data inside the field?

I have tried <%=myrecordset("firstName")%> but failed!


Code: Select all
<% on error resume next %>
<%
    dim adoConn
    dim adoRS
    dim counter
    dim strQuery
    
    set adoConn = Server.CreateObject("ADODB.Connection")
    set adoRS = Server.CreateObject("ADODB.Recordset")
    
    adoConn.Open "Driver={mySQL ODBC 3.51 Driver}; Server=localhost; Port=3306; Option=4; Database=address; Uid=root;Pwd=monie;"
    adoRS.ActiveConnection = adoConn
    
    if adoConn.errors.count = 0 then
    
    response.write "<h2>Fields In The 'Contacts' Table:</h2>"
    adoRS.Open "describe contacts"
    while not adoRS.EOF
    
    response.write adoRS.fields(0).value & "<br>"
    adoRS.MoveNext
    wend
    else
    response.write "ERROR: Couldn't connect to database"
    end if
%>
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Last edited by Monie; Oct 10th, 2007 at 07:15.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 10th, 2007, 09:06
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Connecting/Using MySQL and ASP

Yes, once again. I've done it.
Now I can Throw away my MS Access Application and welcome my brand new friend MySQL

Code: Select all
<% on error resume next %>
<%
Dim sConnection, objConn , objRS

sConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=address; OPTION=4; UID=root;PASSWORD=monie;"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(sConnection)
Set objRS = objConn.Execute("SELECT * FROM contacts")

While Not objRS.EOF
Response.Write objRS.Fields("firstName") & ", " & objRS.Fields("lastName") & "<br>"
objRS.MoveNext
Wend

objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 10th, 2007, 09:22
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 36
Posts: 88
Thanks: 1
Thanked 0 Times in 0 Posts
Re: [SOLVED] Connecting/Using MySQL and ASP

Well done mate.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 11th, 2007, 04:17
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: [SOLVED] Connecting/Using MySQL and ASP

Quote:
Originally Posted by robbied72 View Post
Well done mate.
Thanks robbied, just one more question ...

I am developing my page in ASP-MySQL...

Is there any program like phpmyadmin (MySQL-Interface) that I can use to manage my database?

Thanks..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Last edited by Monie; Oct 11th, 2007 at 06:40.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Oct 11th, 2007, 23:50
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: [SOLVED] Connecting/Using MySQL and ASP

Monie, Visual web developer comes with a built in Database GUI.
It's exactly like PHPMyAdmin,
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Oct 12th, 2007, 09:00
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: [SOLVED] Connecting/Using MySQL and ASP

Thanks alex,

I have downloaded mysql manager from www.mysql.com. It's quiet nice too. But I am looking something that are similar to phpmyadmin.
Maybe I'll look into your suggestion. Did you mean This link?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] XML &gt; MySQL? alexgeek PHP Forum 13 Jan 5th, 2008 10:45
problem connecting to mysql from dreamweaver steven rowlands PHP Forum 6 Mar 18th, 2007 09:11
VS.Net - Connecting to a mySQL databse Tim356 ASP.NET Forum 8 Jul 30th, 2004 03:33
[SOLVED] MySQL to MSSQL Anonymous User Databases 7 Oct 6th, 2003 07:48


All times are GMT. The time now is 14:08.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42