Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to MySQL

Status
Not open for further replies.

oewasmand

Programmer
Apr 13, 2003
5
0
0
US
On my test server I connect to mySQL via asp with the following command:

oConn.Open "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;UID=user;PWD=password;"

This works just fine, but when I upload my site and run the asp page, I get this error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/hosted/insanereality/test.asp, line 15


I know it must be something concerning the driver, but according to my host, I declared it right.
In many post I saw that people just use "{MySQL}" as the driver. But this doesn't work on my computer nor on the server.
Anyone has an idea?
 
driver={MySQL};server=localhost;uid=baddos;pwd=bleh;database=mydatabase

This is what I use.
 
I know, I've seen it many times before, but it won't work on my machine [sadeyes]
 
You didn't specify your database in the connection string.
 
oewasmand,

did you ever get this to work. One question though is your webhost running on IIS?

I have been having the same problem. I have 3 different web servers. All three have the same odbc connections and it tests fine. I can move the same exact page from server to server and it only works on one of them. Which leads me to believe it has more to do with IIS than with the connection string or driver.


AJ
[americanflag]


 
The problem wasn't the connection string (it's not neccesary to specify the database). The server at which it wasn't working didn't have the correct ODBC driver installed. They installed the MyODBC driver now and it's working perfectly.
 
Using MySQL, are there any major differences in scripting? Say for exmaple when trying to post a record to an access db, would the same scripting work for a MySQL db?
 
basically Yes!

there are minor suntax differences as the # # for dates in access verses ' ' in all other DB's.

ASP syntax is generally going to not very much from syntax wise perspectives from one database to the other.

although as I said the SQL syntax will slightly

_________________________________________________________
for the best results to your questions: FAQ333-2924
[sub]01001111 01101110 01110000 01101110 01110100[/sub]
onpnt2.gif
[sup] [/sub]
 
Yes, it would work the same.
The only difference between the technologies lies in creating and opening databases. Handling them is (apart from some exceptions) the same.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top