General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL 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 December 16th, 2002, 05:17 PM
jenpenod jenpenod is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 2 jenpenod User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post Error Connecting to Database

I have just installed MySql to use with ASP and I've been having start-up problems - mostly due to lack of experience!

I followed the devarticles article about using my odbc to Access MySql Database via ASP.

This is the ASP code I am running...

<%

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=mysql_dsn"
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

%>



The error message stated at the end is coming up but I have no idea why or how to fix it. I have tried this code using both a DSN connection and a DSN-Less connection with the same results. Please help! I think everything is ok from the database side of things.

Last edited by jenpenod : December 16th, 2002 at 05:36 PM.

Reply With Quote
  #2  
Old January 6th, 2003, 09:23 AM
condealmasy condealmasy is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 condealmasy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hey Man. I have the same problem

I have the same Problem and I haven't solved it yet.

The funny thing is that I worked once but most of the time it returns the error.

This is what I posted:

I installed the MYSQL ODBC 3.51 and I've used my Mysql database with Visual Basic programming for quite some time now, and it works great.

But now I have to develop a webpage in ASP.

There seems to be a problem with the connection string:

connection.Open "PROVIDER=MSDASQL;driver={MySQL ODBC 3.51 Driver};server=localhost;uid=user;pwd=password;dat
abase=mydb;"

The thing is that this String has worked once or twice and most of the time it doesn't, while the DSN and the database connection in Visual Basic always works.

I have never changed the string, I've used other strings, like the one I read in the whole "Using MyODBC To Access Your MySQL Database Via ASP" article By: Annette Tennison, but still it gives me this error:

Can't find the database source or didn't specify the default driver

I thought that maybe the application "WinMySqladmin Ver 1.4" that comes with the Mysql installation waas the problem, but the problem happens WITH the application running and WITHOUT it.

Many people respond telling me to check the connection string, but I have done that already 1000 times, and it is right, I believe there is a configuration problem with my IIS or the Mysql ODBC.

PLEASE. IF YOU FIND THE SOLUTION. RESPOND IT IN THIS FORUM PLEASE

Reply With Quote
  #3  
Old January 23rd, 2003, 05:07 PM
tjletourneau tjletourneau is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 1 tjletourneau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Trying to use VB to connection to MYSQL DB

Does anyone have sample code in Visual Basic on how to connect to a MYSQL database and return or bring back records?
I used Sybase connections before but never MYSQL.

Thanks.

Reply With Quote
  #4  
Old June 2nd, 2003, 09:55 AM
ekraft84 ekraft84 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 7 ekraft84 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Has anyone found a solution to condealmasy's problem? I'm experiencing the same thing.

Reply With Quote
  #5  
Old August 10th, 2003, 05:03 PM
tyler tyler is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 1 tyler User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
My Fix

I was having the same problem until just now - I used the code provided by condealmasy:

connection.Open "PROVIDER=MSDASQL;driver={MySQL ODBC 3.51 Driver};server=localhost;uid=;pwd=;database=myDB;"

And it was spitting out the same errors. I searched on URL for a fix and found that after installing MyODBC 3.51x driver, the code above worked flawlessly.

The URL for the dirver can be found at:

URL

I hope it works for you all as well!

Good luck!

Last edited by tyler : August 10th, 2003 at 05:12 PM.

Reply With Quote
  #6  
Old October 17th, 2003, 08:23 AM
tnker32 tnker32 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 tnker32 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SOLUTION

A nice Tech from MySQL AB sent me this solution to this:

"This is a known issue, and you can cross check this from Microsoft KB
article 306345 on how to resolve this."


This returned 2 articles in my search. They will resolve your issue.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Error Connecting to Database


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 5 hosted by Hostway