moose2004 Posted April 27, 2010 Share Posted April 27, 2010 How do you connect to a MySQL database with script? This is what i have started with.... global dbase global qr dbase = db.OpenEx("DRIVER={MYSQL ODBC 3.51 Driver};SERVER='localhost';DSN='Test';UID='root';PWD='';DATABASE='Test'") qr = db.Query(dbase,"select * from demo") if(qr == 1) system.MessageBox('found') else system.MessageBox('not found') endif db.CloseQuery(qr) db.Close(dbase) ***All i am doing is checking to see if a table exists.... Any ideas? Link to comment Share on other sites More sharing options...
AzeoTech Posted April 27, 2010 Share Posted April 27, 2010 qr won't = 1. It returns a handle, but you can check for non-zero. Either way, use querytoclass() instead of query(). Really these are the only db. commands you need: open() / openEx() close() queryToClass() : for SELECT statements execute() : for all other SQL commands queryToClass() is documented in this forum. Just do a search. Link to comment Share on other sites More sharing options...
moose2004 Posted April 27, 2010 Author Share Posted April 27, 2010 Okay i will try but i still having a problem connecting to the DB via script. I am having the same problem these people are/were having.... http://www.azeotech.com/board/index.php?showtopic=3417 Was this ever resolved?? Link to comment Share on other sites More sharing options...
AzeoTech Posted April 27, 2010 Share Posted April 27, 2010 I don't know. Most people don't post when they get it working, so presumably it was a typo. I have never had a problem getting db. working. The only issue I ever had was with the MySQL ODBC connector under 64 bit. It installs to the wrong directory. I find it easier to use their 3.x version than their 5.x version of the connector. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.