Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foxpro and Mysql
Message
De
11/03/2003 10:13:16
Albert Beermann
Piepenbrock Service Gmbh & Cokg
Osnabrück, Allemagne
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Foxpro and Mysql
Divers
Thread ID:
00764227
Message ID:
00764227
Vues:
61
Hello everybody !!
I'm experimenting with Foxpro and a My_SQL Database (Windows) !
The server is up and running ! I can connect ! I can read data into Foxpro cursors !



But i have problems with update and insert ??

The following example code is working.

local l_verbindungsnr
*open the connection
do p_open in p_funktionen with l_verbindungsnr

if l_verbindungsnr >= 0
l_fehler = SQLPREPARE(l_verbindungsnr,'INSERT into t_adressen SET adressnr = "47111",name1="Tester"')
l_fehler1= SQLEXEC(l_verbindungsnr)
messagebox(str(l_fehler) + " " + str(l_fehler1))
endif

*******************

Now i want the insert data from a local cursor or table
fieldtypes in mysql are char(6) and char(30)
fieldtypes in t_data are c(6) and c(30)
local l_verbindungsnr
use t_data
set order to
seek(...)
if found()
l_adressnr = t_data.adressnr
l_name1 = t_data.name1
endif
*open the connection
do p_open in p_funktionen with l_verbindungsnr

if l_verbindungsnr >= 0

l_fehler = SQLPREPARE(l_verbindungsnr,'INSERT into t_adressen SET adressnr = l_adressnr,name1=l_tester')
l_fehler1= SQLEXEC(l_verbindungsnr)
messagebox(str(l_fehler) + " " + str(l_fehler1))
endif

This brings up -1 for the sqlprepare and -1 for the sqlexec !

i tried this:
l_fehler = SQLPREPARE(l_verbindungsnr,'INSERT into t_adressen SET adressnr = @l_adressnr,name1=@l_tester')
l_fehler1= SQLEXEC(l_verbindungsnr)
messagebox(str(l_fehler) + " " + str(l_fehler1))

This brings up 1 for the sqlprepare and -1 for the sqlexec !


Same problem with update !! Direct values work fine !! No success with variables !! The messagebox brings up 1 and 1 , but no update is done (record not found)

What I'm doing wrong ???? Do i have to convert the fields from the table or cursor ??

Any help welcomed.
Best regards
Albert
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform