Changing database on the same cursor with mysql database

forum.connectivity (1998-2005) & forum.td.connectivity (2005-2010)
Jean-Philippe Victoire

Changing database on the same cursor with mysql database

Post by Jean-Philippe Victoire » 10 Sep 2008, 18:18

 Posted by:  Jean-Philippe VICTOIRE 

Hi NG,

I'm using a mysql database.

I created the cursor in ODBC administrator without the database which
is optional.

Each day, i got a new database create by a software and i would like to
know if there is a way to connect at runtime on one or more database
with only this cursor.

Maybe there is a way to select the good database on the server at
runtime.

Hope you could help my on this issue.

Best regards

Jean-Philippe Victoire

Re: Changing database on the same cursor with mysql database

Post by Jean-Philippe Victoire » 25 Sep 2008, 18:16

 Posted by:  Jean-Philippe VICTOIRE 

hi all,

I installed myoledb3 for mysql.

And then i make connection dynamically to the database with sqlUDL.

i changed the database every time i need to connect on another database

sample :
Set SqlUser = toto
Set SqlPassword = toto
Set SqlDatabase = sDATABASE
Set SqlUDL = "Provider=MySqlProv;Location=" || sSERVER
If NOT SqlCreateSession( hSgAST, SqlUDL)
Return FALSE
If NOT SqlCreateStatement( hSgAST, hSqlgAST )
Return FALSE

And then you can use the cursor as you used to do it.

Good luck !!! :-)

Return to “td.connectivity”

Who is online

Users browsing this forum: [Ccbot] and 0 guests