Update problem

Results 1 to 4 of 4

Thread: Update problem

  1. #1
    Jason Buck Guest

    Default Update problem

    I&#039m having a problem with the following code.<BR><BR>&#060;%<BR><BR>strClimat = Request.Form("climat")<BR>strcliname = Request.Form("cliname")<BR>strselstate = Request.Form("selstate")<BR>strhdob = Request.Form("hdob")<BR>strwdob = Request.Form("wdob")<BR>strselrespatty = Request.Form("selrespatty")<BR>strselcorpfid = Request.Form("selcorpfid")<BR>strselattyfid = Request.Form("selattyfid")<BR>strselhuasset = Request.Form("selhuasset")<BR>strselwiasset = Request.Form("selwiasset")<BR>strselcoasset = Request.Form("selcoasset")<BR>strmemo = request.form("memo")<BR>strorgdate = Request.Form("orgdate")<BR>strmoddate = date()<BR>strmodtime = time()<BR>strmodwho = Request.Form("modwho")<BR>stroffloc = Request.Form("offloc")<BR><BR><BR><BR>strConnect7 = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:database e1.mdb"<BR><BR>dim objconn7, objrec7, mysql7, strStatus7, Mytest7, strLength7<BR>set objconn7 = server.createobject("ADODB.Connection")<BR><BR>&#0 39this is all on one line, the textarea wrapped it on the form<BR>mysql7 = "Update CLIENT SET cliname=&#039" & strcliname & "&#039, client.state=&#039" & strselstate & "&#039 Where climat=" & strClimat<BR><BR>&#039I have tried to do this will all the strings but I have moved down to 2 just to try to get it to submit successfully.<BR><BR>objConn7.open strConnect7<BR><BR><BR><BR><BR>set rstemp7 = objConn7.execute(mysql7)<BR><BR><BR><BR>rstemp7.cl ose<BR>set rstemp7 = nothing<BR>objconn7.close<BR>set objconn7 = nothing<BR><BR>Response.write "The changes you made were successful<BR>"<BR>%&#062;<BR>This is one of the errors that I get<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e07&#039 <BR><BR>[Microsoft][ODBC Microsoft Access 97 Driver] Data type mismatch in criteria expression. <BR><BR>/te/updateclient.asp, line 38 <BR><BR><BR>any help would be greatfully appreciated.<BR><BR>webmaster@wnj.com<BR><BR>

  2. #2
    Shawn Claboug Guest

    Default RE: Update problem

    What are your datatypes for cliname, state and climat? If climat is a text field, you are missing some single quotes around it in the WHERE clause.

  3. #3
    Jason Buck Guest

    Default RE: Update problem

    I hate those single quotes. Totally spaced that one.<BR><BR>Thnak you, that was all that I needed

  4. #4
    Solution Guest

    Default RE: Update problem

    If I got you SQL correctly copied<BR><BR>mysql7 = "Update CLIENT SET cliname=&#039" & strcliname & "&#039, client.state=&#039" & strselstate & "&#039 Where climat=" & strClimat<BR><BR>You are missing the quotes on your where clause.<BR>i think it should be<BR>mysql7 = "Update CLIENT SET cliname=&#039" & strcliname & "&#039, <BR>client.state=&#039" & strselstate & "&#039 Where climat=&#039" & strClimat &"&#039"<BR><BR>I am not sure this will solve your problem, but worth a try<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
  •