Type Mismatch error
new_learner | Posted 9:00pm 15. February 2010 Server Time |
When i newly created the DB in the access, it worked fine but when i deleted all the records and then i tried to add new records it gives me this error:
To void any confusion i have kept all the datatypes as text even for dates.
------------------
Error Type:
Provider (0x80020005)
Type mismatch.
/rollout/adding_backend.asp, line 25
-------------------
Please help me, i am near to completion of my assignment..and now the DB is screwed. I tried to google through this issue but not getting any accurate solution.
My code:
<%
dim conn, a
dim rs
dim strID
dim strconn
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("Rollout.mdb")
set conn = server.createobject("adodb.connection")
conn.open strconn'
set rs = server.createobject("adodb.recordset")
'This statement opens the table so we can add a record notice the addnew
'The 2, 2 is how the table is opened there are many ways it can be opened
rs.open "Schedules", conn, 2, 2
rs.addnew
rs("Release_Name") = request("release_name")
rs("Change_Number") = request("change_number")
rs("Change_Owner") = request("change_owner")
rs("Task_Owner") = request("task_owner")
rs("ADate") = request("date1")
rs("BDate") = request("date2")
rs("CDate") = request("date3")
rs("DDate") = request("date4")
rs("A1") = request("A1")
rs("A2") = request("A2")
rs("A3") = request("A3")
rs("A4") = request("A4")
rs("A5") = request("A5")
rs("B1") = request("B1")
rs("B2") = request("B2")
rs("B3") = request("B3")
rs("B4") = request("B4")
rs("B5") = request("B5")
rs("C1") = request("C1")
rs("C2") = request("C2")
rs("C3") = request("C3")
rs("C4") = request("C4")
rs("C5") = request("C5")
rs("D1") = request("D1")
rs("D2") = request("D2")
rs("D3") = request("D3")
rs("D4") = request("D4")
rs("D5") = request("D5")
rs("AStatus") = request("AStatus")
rs("BStatus") = request("BStatus")
rs("CStatus") = request("CStatus")
rs("DStatus") = request("DStatus")
rs.update
'I do a movelast here to get the ID that is automatically generated
'I also set the value to a local variable so I can write out to the database
set rs= nothing
set conn = nothing
%>
|
katy8439 | Posted 7:24am 16. February 2010 Server Time |
Are you actually receiving data from the form? I'm assuming you're posting data to your query from a form anyway
If you Response.Write out the values are you getting any data?
Before you open your database connection write out the data like so:
<%
For ix = 1 to Request.Form.Count
fieldName = Request.Form.Key(ix)
fieldValue = Request.Form.Item(ix)
Response.write fieldName & " " &fieldValue&"<br />"
Next
%>
If there's no data coming through that's probably the problem - check that your field allows zero length and isn't required
new_learner | Posted 10:39pm 17. February 2010 Server Time |
Yes, I am getting the data from the form, and i also getting the response.write for all the Date values(ADate,BDate,CDate,DDate) and in the db field is set to allows zero length and isn't required.
Problem is somewhere in date, Its not letting me keep date fields empty when i try to add a record...pls help.
new_learner | Posted 10:42pm 17. February 2010 Server Time |
info...When i enter all the 4 dates fields it allows me to add the record. I have even tried to change the datatype to Date for this fields but same issue.
Reply to Post Type Mismatch error
|
|
|