PUBLIC lcServer as Character,lcDatabase as Character
PUBLIC lcUser as Character,lcPassword as Character, lcStringConn as Character
lcServer="localhost"
lcDatabase="empresa"
lcUser = "abel"
lcPassword = "123"
lcStringConn="Driver={MySQL ODBC 3.51 Driver};Port=3306"
lcStringConn=lcStringConn+";Server="+lcServer
lcStringConn=lcStringConn+";Database="+lcDatabase
lcStringConn=lcStringConn+";Uid="+lcUser
lcStringConn=lcStringConn+";Pwd="+lcPassword
***Evitar que aparezca la ventana de login
PUBLIC lcDSNLess as Character
lcDSNLess="DRIVER={MySQL ODBC 3.51 Driver};" ;
+ "SERVER=localhost;" ;
+ "UID=abel;" ;
+ "PWD=123;" ;
+ "DATABASE=empresa;"
SQLSetprop(0,"DispLogin",3)
lnHandle=Sqlstringconnect(lcDSNLess)
If lnHandle > 0
?SQLTables(lnHandle,"TABLES"
Brow
* SQLDisconnect(lnHandle)
ELSE
=Aerror(elError)
Messagebox("Error de conexión"+Chr(13)+;
"Descripcion:"+elError[2])
Endif
lcDSNLess="DRIVER = {MySQL ODBC 3.51 Driver};" ;
+ "SERVER=localhost;" ;
+ "UID=abel;" ;
+ "PWD=123;" ;
+ "DATABASE=empresa;"
lnConnHandle=SQLSTRINGCONNECT(m.lcDSNLess)