Results 1 to 3 of 3

Thread: SQL - insert

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    18

    SQL Insert having an auto number field..

    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]

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Springfield, IL
    Posts
    124
    Have you tried this:

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




  3. #3
    Addicted Member
    Join Date
    Jan 2000
    Location
    Oshkosh, WI
    Posts
    163
    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width