Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Passthru
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00719981
Message ID:
00720545
Vues:
18
OK! I think I found the answer!
Apparantly since I was prototyping against a VFP datasource using SQL passthu I ran into what I suppose is a bug in the ODBC driver. The problem was that many of the fields were date or datetime fields and if any one of those fields was empty, the insert or update command would fail. When I upsized the database to SQL server and ran the same code - everything worked fine! I guess I will have to write yet another wrapper layer to deal with empty date and datetime fields.

Troy



>I am trying to write to a table using SQL Passthru from a record object created from the scatter command. I basically scattering to an object modifying the properties and wish to insert the changes back.
>
>I can't build the text because in some cases the values include quotes and such, but even in the most simple cases it is not working.
>
>oRec.Field1 = 'Test1'
>oRec.Field2 = 123
>
>if I do:
>sqlexec(iCH,'insert into table (field1,field2) values (oRec.Field1,oRec.Field2)
>
>the record is inserted, but the field are blank
>
>if I do:
>
>sqlexec(iCH,insert into table (field1,field2) values (?oRec.field1, oRec.Field2)
>
>I get a returned (-1) where the aerrors method tells me:
>Connectivity error: [Microsoft][ODBC Visual FoxPro Driver]Data type mismatch.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform