Adding to database error

Results 1 to 3 of 3

Thread: Adding to database error

  1. #1
    Join Date
    Dec 1969
    Posts
    9

    Default Adding to database error

    I am trying to add to a db but i keep om getting the following error:<BR><BR>[Microsoft][ODBC Microsoft Access 97 Driver] Number of query values and destination fields aren&#039t the same. <BR><BR><BR>This is true because i have an id field in the db which is autonumbered so therefore i am not adding to it.<BR><BR>Any ideas?????

  2. #2
    Jason Buck Guest

    Default RE: Adding to database error

    Your error message is telling you that in your INSERT Statement the number of fields doesn&#039t match...ie<BR><BR>YourSQL = "INSERT INTO yourtable (field1, field2) values (&#039" & str1 & "&#039,&#039" & str2 & "&#039);"<BR><BR>If you have the same number fields and strings, the you missed a comma somewhere.....ie xx,xx is where you might have forgot the comma.<BR><BR>YourSQL = "INSERT INTO yourtable (field1 xx,xx field2) values (&#039" & str1 & "&#039xx,xx &#039" & str2 & "&#039);"<BR><BR>If this doesn&#039t help you, feel free to contact me.<BR><BR>Respectfully,<BR><BR>Jason<BR>webmaster @wnj.com<BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    9

    Default RE: Adding to database error

    That was it. <BR>Thanks very much<BR>Regards,<BR>Dave.

Posting Permissions

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