INSERT Problem - Will Pay For Answer!!!

Results 1 to 3 of 3

Thread: INSERT Problem - Will Pay For Answer!!!

  1. #1
    Warren Guest

    Default INSERT Problem - Will Pay For Answer!!!

    I&#039ve been trying to figure this problem out for over a month and the first person to come up with the right answer will get $20 mailed to them! Not kidding either...<BR><BR>I can use INSERT to write data to my access database for Text format fields but any time I use the same code with Memo fields, I get a Syntax error.<BR><BR>All I do is replace the Desc field name with another Text field name and it works great and inserts the data. But replace it with a memo field name and it does not work.<BR><BR>Here is the code I am using:<BR><BR>Set MYCONN = server.CreateObject("ADODB.connection")<BR>Set RS = server.CreateObject("ADODB.recordset")<BR>MYCONN.o pen "Tell"<BR><BR>SQL1 = "INSERT INTO Email(Desc) VALUES(" & "&#039" & Desc1 & "&#039)"<BR><BR>response.write SQL1 <BR><BR> SQL1, MYCONN<BR>%&#062;<BR><BR>If you know the answer to this, please email me and I&#039ll give it a try. If it works, I&#039ll send ya $20 to go to the movies with! (seriously).<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default I accept VISA, MasterCard, and Discover

    Just kidding.<BR><BR>You need to change the field name from "Desc" to something else, like "Desc1". Access (for some reason) thinks "DESC" is a reserved word and it causes a syntax error.<BR><BR>Good luck, let me know if it works.<BR><BR>Allen

  3. #3
    yvo volders Guest

    Default RE: INSERT Problem - Will Pay For Answer!!!<BR><BR>I&#039ll give you the answer for free, believe me.<BR><BR>Don&#039t use the open but the execute, you made a common mistake. The open is for retrieving recordsets, which the insert and delete do not do.<BR><BR>Do the following :<BR><BR> Set MYCONN = server.CreateObject("ADODB.connection")<BR> SQL1 = "INSERT INTO Email(Desc) VALUES(" & "&#039" & Desc1 & "&#039)"<BR> response.write SQL1 <BR> MYCONN.execute SQL1<BR><BR><BR>If this works, send me a mail, and have a beer between friends with the 20 bucks.<BR><BR><BR>

Posting Permissions

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