Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modifying Microsoft Access Tables
Message
 
To
19/07/2004 11:31:30
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00920636
Message ID:
00925878
Views:
20
Your code looes okay - it may be helpful to place a semi-colon after the closing paren ");" for the values clause.

?SQLEXEC(lnconn, "INSERT INTO inve01(num_reg, clv_art, status) VALUES (79, '12100', 'A')")

I ran an insert with an Acces DB (did not use prepare or commit) to test. It bugged out. SO I did the following to see the errors (right after the -1 was returned:
AERROR(arSQL)
list memory like 'arSQL'
The arSQL array told me I could not have nulls in a field (dbIndex). So I assigned the next incremental value, and got a 1 (success)!
So maybe just looking at the array will help. There may be triggers assiciate with the your DB - but see what AERROR tells you first!


>This is the code I am using, the UPDATE appears to work fine, but not the INSERT, I get a -1 ,
>I´ve also tried it without the SQLPREPARE, but to no avail.
>
>
>
>
>lnconn=SQLCONNECT("saeacces")
>? lnconn
>?SQLPREPARE(lnconn, "INSERT INTO inve01(num_reg, clv_art, status) VALUES (79, '12100', 'A')")
>?SQLEXEC(lnconn)
>SQLEXEC(LNCONN,"UPDATE INVE01 SET UNI_EMP = UNI_EMP+11 WHERE CLV_ART = 'HUESO'")
>?SQLCOMMIT(lnconn)
>?SQLEXEC(lnconn,"select * from inve01")
>BROWSE
>?SQLDISCONNECT(lnconn)
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform