Data Mismatch Error

Results 1 to 2 of 2

Thread: Data Mismatch Error

  1. #1
    Join Date
    Dec 1969

    Default Data Mismatch Error

    Hi All,<BR>I am getting error when i am executing asp actually i am using insert into statement and collecting the values using request.form i think that because i am using list box for date like month,day,year in first asp and then using cdate function to convert it i am pasting the code down here could somebody look at it and give me sugguestion what to do.<BR>Thankx in advance<BR><BR>here is code <BR><BR>strTemp = CDate(request.form("m1")& "/" &request.form("m2") & "/" & request.form("m3"))<BR>d1=request.form("d1")<BR>p1 =request.form("pj1")<BR>p2=request.form("pj2")<BR> p3=request.form("pj3")<BR>p4=request.form("pj4")<B R>p5=request.form("pj5")<BR>p4=request.form("pj6") <BR>p7=request.form("pj7")<BR>p8=request.form("pj8 ")<BR>t1=request.form("t1")<BR>t2=request.form("t2 ")<BR>t3=request.form("t3")<BR>t4=request.form("t4 ")<BR>t5=request.form("t5")<BR>t6=request.form("t6 ")<BR>t7=request.form("t7")<BR>t8=request.form("t8 ")<BR>level1=request.form("level1")<BR>level2=requ est.form("level2")<BR>level3=request.form("level3" )<BR>level4=request.form("level4")<BR>level5=reque st.form("level5")<BR>review1=request.form("review1 ")<BR>review2=request.form("review2")<BR>review3=r equest.form("review3")<BR>review4=request.form("re view4")<BR>review5=request.form("review5")<BR>&#03 9un=session("auser_name")<BR><BR>Set Con = Server.CreateObject("ADODB.Connection")<BR>Con.Ope n "DSN=test"<BR>SET RS = Server.CreateObject("ADODB.Recordset")<BR>RS.Open "SELECT * FROM EmpTrans WHERE 1 &#060;&#062; 1", Con<BR><BR>if P1 &#060;&#062; "NA" then<BR>sql = "INSERT INTO EmpTrans (User_Name, sDate, Activity, Duration, Reviewed, Process_id)" <BR>sql = sql & " VALUES(&#039" & session("auser_name") & "&#039, &#039" & strTemp & "&#039, &#039" & p1 & "&#039, &#039" & t1 & "&#039, &#039" & level1 & "&#039, &#039" & review1 &"&#039)"<BR>response.write sql<BR>Con.Execute sql<BR>response.write("Record Inserted ")<BR>end if

  2. #2
    Join Date
    Dec 1969

    Default RE: Data Mismatch Error

    The SET RS and RS.OPEN lines are completely unnecessary (at least in this code), why are you doing that?<BR><BR>Also, the cdate function in this case is not necessary. Just build the date as a string and see if that alleviates the problem.<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