PDA

Click to See Complete Forum and Search --> : SQL - insert


zambian
Mar 20th, 2000, 02:38 AM
Hi there,

I have an auto-number field, and two number fields in a table.

How do I write an insert statement to insert values in the table ?

I tried this but it failed..

db.Execute "insert into doc(auNum,numA,numB) values ( ,cid,mid,);"

where cid and mid hold the values of the numbers to be inserted.

I also tried :
db.Execute "insert into doc(cID,mID) values(x,y);"
without any success.
It says: "Too few parameters. Expected 2"

Any help/comments on this will be grateful.

Thank You
Hemang

[Edited by zambian on 03-20-2000 at 04:59 PM]

bsmith
Mar 20th, 2000, 03:14 AM
Have you tried this:

db.Execute "insert into doc(numA,numB) values (cid,mid);"

Glenn
Mar 20th, 2000, 10:16 PM
Try

db.Execute "insert into doc(cID,mID) values(" & x & "," & y & ");"

If the values are strings you will have to enclose them in single quotes.