Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    9

    Question Unanswered: Number of query values and destination fields are not the same.

    hi...i keep getting this error...i KNOW why im getting, i just dont know any way around it...im using session variabes from a form and they are being inserted into an access db...the problem is that my database has one extra field which is my primary key "ID" (autonumber)...it works fine when i take it out, but then im left without a primary key...my statement looks like this...

    sSQL = "INSERT into appTest_tbl values ('" & _
    (Session.SessionID) & "','" & Session("lastname") & "','" & Session("firstname") & "','" & Session("midname") & "','" & Session("presentstreet") & "')"


    because im adding 5 fields to a database which has 6 openings it gives me this error...any ideas? thanks for your time...

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    try specifying your column values eg...

    sSQL = "INSERT into appTest_tbl (col2, clo3, col4, col5, col6) values ('" & _
    (Session.SessionID) & "','" & Session("lastname") & "','" & Session("firstname") & "','" & Session("midname") & "','" & Session("presentstreet") & "')"

Posting Permissions

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