MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 8th, 2003, 11:19 AM
admiral_chiu admiral_chiu is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 admiral_chiu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Need help regarding the "Using MyODBC To Access Your MySQL Database Via ASP" article

Hello,

I am pretty new to ASP and I have a problem using it with mySQL.

I am using ODBC on my Win 2000 server for ASP application. I have set up
an ODBC driver (3.51) for mySQL and was able to create a local database. I
am facing a rather interesting problem:

I followed the instruction from a tutorial and set up a system DSN called
personalweb. After verifying the connection, I continued on and created a
sample ASP page to test it:

<%

on error resume next

dim adoConn

dim adoRS

dim counter

set adoConn = Server.CreateObject("ADODB.Connection")

set adoRS = Server.CreateObject("ADODB.Recordset")

adoConn.Open "DSN=personalweb"

adoRS.ActiveConnection = adoConn

if adoConn.errors.count = 0 then

response.write "<h2>Fields In The 'ruser' Table:</h2>"

adoRS.Open "describe ruser"

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

%>

Everything works, the columns were shown in the ASP page...

Now, the problem is when I continued on and follow the second instruction
in the tutorial and subsitute what I had with the following code:

<%

on error resume next

dim adoConn

dim adoRS

dim counter

set adoConn = Server.CreateObject("ADODB.Connection")

set adoRS = Server.CreateObject("ADODB.Recordset")

adoConn.Open "driver=
{mysql};database=personalinfo;server=localhost;uid =adminbchiu;pwd=qwerty;"

adoRS.ActiveConnection = adoConn

if adoConn.errors.count = 0 then

response.write "<h2>Fields In The 'ruser' Table:</h2>"

adoRS.Open "describe ruser"

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

%>

The only thing I can get is the error message.

I am wondering what I have done wrong... Please help. Thanks

Reply With Quote
  #2  
Old May 21st, 2003, 06:45 AM
wishful wishful is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 3 wishful User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
OBDC Driver

Hello

You need to enter the name of your driver into the {}

Eg.

Driver ={MySQL ODBC 3.51 Driver}

If you are using windows you can check the exact name of you driver in the ODBC Admin section in Control panel.

Nick

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Need help regarding the "Using MyODBC To Access Your MySQL Database Via ASP" article


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT