Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert Into Access table
Message
De
04/06/2002 11:33:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/06/2002 04:59:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00664348
Message ID:
00664526
Vues:
21
>I have the following code for inserting a record into
>an access table, but nothing happens.
>
>SQLEXEC(lnAccess,"INSERT INTO mytable (mytable.no,mytable.batch,mytable.filename) VALUES (?tmpdata.no,?tmpdata.batch,?tmpdata.filename)", "Mytable")
>
>lnAccess is a valid connection.
>
>Anyone any ideas?

Ger,
As an addition to what Daniel said :
-Do use question marks
-Use square brackets around fieldnames (no, batch, filename might be offending as fieldnames)
-Break string into smaller pieces
ie:
*...
lnResult = SQLEXEC( lnAccess,"INSERT INTO mytable "+;
   "([no],[batch],[filename])"+;
   " VALUES "+;
   "(?tmpdata.no,?tmpdata.batch,?tmpdata.filename)" )
if lnResult < 0
   =AERROR(aErrorArray)
   CLEAR
   FOR ix = 1 TO 7
      ? aErrorArray(ix)
   ENDFOR
endif
SQLDisconnect(lnAccess)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform