Environment versions
Network:
Windows 2000 Server
Christian,
For reference, the code will be almost like that.
Declare Integer mysql_init In libmySQL.Dll;
Integer db_ID
Declare Integer mysql_close In libmySQL.Dll ;
Integer db_ID
Declare Integer mysql_real_connect In libmySQL;
INTEGER lMYSQL, ;
STRING sHostName,;
STRING sUserName,;
STRING sPassword,;
STRING sDbName,;
INTEGER lPortNum,;
STRING sSocketName,;
INTEGER lFlags
Declare Integer mysql_query In libmySQL ;
INTEGER lMYSQL, ;
STRING sCadena
db_ID = 0
db_ID = mysql_init(db_ID)
If db_ID = 0 Then
MESSAGEBOX("error mysql_init "+ db_ID)
End
Endif
HostNam = "127.0.0.1"
UserNam = "root"
PassWrd = "oaktree"
DB_Name = "DATOS1" && Nombre de la Base de Datos
PortNum = 3306
test=mysql_real_connect(db_ID,HostNam, UserNam, PassWrd, DB_Name, PortNum,"",0)
? mysql_query(db_ID, "create database DATOS1")
? mysql_query(db_ID, "CREATE TABLE DATOS1.Tabla1(campo1 Varchar(100))")
? mysql_query(db_ID, "INSERT INTO DATOS1.Tabla1 SET campo1='DDDDD'")
? mysql_query(db_ID, "COMMIT")
? mysql_close (db_ID)
IF test=0
MESSAGEBOX("error mysql_real_connect")
ELSE
MESSAGEBOX("OK mysql_real_connect")
? test
Endif
Best regards,
Laercio Fortes
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only