Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP x Mysql
Message
 
 
À
10/04/2005 18:08:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MySQL
Divers
Thread ID:
01001320
Message ID:
01003262
Vues:
308
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform