Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert Into Access table
Message
From
04/06/2002 11:33:08
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
04/06/2002 04:59:03
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00664348
Message ID:
00664526
Views:
23
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform