Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP x Mysql
Message
From
10/04/2005 21:04:24
 
 
To
10/04/2005 18:08:50
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MySQL
Miscellaneous
Thread ID:
01001320
Message ID:
01003262
Views:
304
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
Map
View

Click here to load this message in the networking platform