Results 1 to 3 of 3

Thread: Insert

  1. #1
    Join Date
    Dec 1969

    Default Insert

    I am currently trying to insert &#039;strings&#039; and integers from a form into a database. I continue to get this error message:<BR><BR>[Microsoft][ODBC Microsoft Access 97 Driver] Data type mismatch in criteria expression. <BR><BR>here is my sql statement:<BR>INSERT INTO Document (DocNum, FileName, DocDescr, Author, Active, OldClause, OrigDept, Rev, DocTier) Values(&#039;EP 4.000&#039;, &#039;G:InetPubwwwrootspqadocsspekevin1.txt&#039;, &#039;Product Development Procedure&#039;,&#039;Tom Pouchot&#039;,&#039;Released&#039;,7,&#039;CB Design Engineering&#039;,6,&#039;Form&#039;) <BR><BR>I am trying to use this code for one form request:<BR>&#060;%Response.Write Upload.Form("Rev")<BR>Rev = Replace(Upload.Form("Rev"),"&#039;","&#039;&#039;" )%&#062;<BR><BR>I&#039;m not sure what this code does or why I have to use it....??

  2. #2
    Join Date
    Dec 1969

    Default RE: Insert

    Go into your database program and make sure that you have each field set to the correct data type. That code is for replacing the apostrophes with two apostrophes, which asp wont muck up. See how you use the apostrophes in your sql? Thats so that doesnt mess up. That response.write upload.form("rev") is completely unecessary though.

  3. #3
    Join Date
    Dec 1969

    Default Actual problem is here!!

    You are trying to insert "10" values in "9" fields in the database, check the number of fields in the INSERT statement and then check the number of values you are trying to insert, though I think it should have given the error as something like "wrong number of arguments..."<BR>well thats what I think could be the error, did I count the numbers right ? :)

Posting Permissions

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