Insert into Database error

Results 1 to 5 of 5

Thread: Insert into Database error

  1. #1
    Raymond Guest

    Default Insert into Database error

    I am trying to INSERT INTO a database and am having the following error:<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e07&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. <BR><BR>/insert.asp, line 71 <BR><BR>line 71 is where I do a set rsADO = cnADO.Execute(mySQL)<BR><BR>I also do a response.write just to check what my mySQL statement comes out like and it shows this:<BR>INSERT INTO customer (First, Last, Company, Title, Address, Address2, City, State, Zip, Phone, Fax, Email, MailList, Access, Password ) VALUES (&#039f&#039,&#039&#039,&#039&#039,&#039&#039,&#03 9&#039,&#039&#039,&#039&#039,&#039Alabama&#039,&#0 39&#039,&#039&#039,&#039&#039,&#039&#039,YES,&#039 customer&#039,&#039&#039)<BR><BR>MailList is not a text field that I know of (in access it is either Yes or No and won&#039t allow you to put any other text string)<BR><BR>So what could be a data type mismatch?

  2. #2
    Join Date
    Dec 1969
    Posts
    52

    Default RE: Insert into Database error

    I&#039m not sure abt the YES/NO thingy, but maybe you can try quoting(&#039&#039) it.<BR><BR>Do you have other fields that are not text?

  3. #3
    Join Date
    Dec 1969
    Posts
    197

    Default RE: Insert into Database error

    It&#039s is 2:07am and I have been fighting with the same problem for about 2 hours, but I got it. Here it is: Make sure your Yes/No fields is like this: Yes. Got it. Capital Y, lowercase e, lowercase s. No quotes please. Let me know if this works for you. jose@ucsnaples.com

  4. #4
    rusy Guest

    Default RE: Insert into Database error

    THIS PROBLEM ONLY COMES WHEN THE DATATYPE INTO THE INSERTING DATABASE FIELD IS NOT TEXT<BR><BR>FOR DATE USE dATEVALUE(&#039&#039"&YOURDATE&"&#039) AND INTEGER USE VAL(&#039"&YOURNO&"&#039)<BR>I THINK THE PROBLEM IS PHONE FIELD IT MAY BE A INTEGER FIELD <BR>IF STILL DOES NOT WORK BREAK UP THE CODE INTO SMALL PIECES AND RUN IT BIT BY BIT IT WILL SOLVE ITSELF<BR><BR>rusy<BR>info@softspark.com


  5. #5
    Join Date
    Dec 1969
    Posts
    119

    Default RE: Insert into Database error

    &nbsp;<BR> I think some of ur table fileds in are NULL . You are<BR> inserting &#039&#039 for some fields which will give an error if<BR> one or more fields have &#039null&#039 assigned to it.<BR><BR> so check the table fields if there is any null field(s) then<BR> insert NULL for that paricular field(s)<BR><BR> Arvind.

Posting Permissions

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