|
<%
'Collating all the information from the form using the the request command.
fname = TRIM(request("fname")) sname = TRIM(request("sname")) uname = TRIM(request("uname")) pswd = TRIM(request("pswd")) addra = TRIM(Request("addra")) addrb = TRIM(Request("addrb")) county = TRIM(Request("county")) postcode = TRIM(Request("postcode")) telno = TRIM(Request("telno")) fax = TRIM(Request("fax")) email=Trim(Request("email"))
'Error checking of the element thatg make up the form
if fname = "" then
strError = strError & "Enter your first name.<BR>" end if if sname = "" then
strError = strError & "Enter your surname.<BR>" end if if uname = "" then
strError = strError & "Enter a user name.<BR>" end if if pswd = "" then
strError = strError & "Enter a password .<BR>" end if
if addra = "" then
strError = strError & "Enter in your address line 1.<BR>" end if
if addrb = "" then
strError = strError & "Enter in your address line 2.<BR>" end if
if county = "" then
strError = strError & "Enter in your City or County.<BR>" end if
if postcode="" then strError = strError & "Enter your Postcode <BR>"
end if
if telno = "" then
strError = strError & "Enter your Telephone<BR>"
end if
if email="" then strError = strError & " Enter your email<br>" else if (instr(1, email,"@")=0) or (instr(1, email, ".")=0) then strError = strError & " Invalid email<br>" end if end if
' if there are any error they will be picked up by this next term
if strError <> "" then
%> <!-- Note the error --> <b> There is an error in your registration request: </b> </span> <p> <span class="error"> <%
' Write out the error messages Response.Write strError
%> </span> <br> Click <a href="userupdate.asp" class="purp">here</a> to update. <%
' If there are any probelms with form the information is placed into sessionvariable ' for when you are sent back to last page. Session("fname") = request("fname") Session("sname") = Request("sname") Session("uname") = Request("uname") Session("pswd") = Request("pswd") Session("addra") = Request("addra") Session("addrb") = Request("addrb") session("county") = Request("county") Session("postcode") = Request("postcode") Session("telno") = Request("telno") Session("fax") = Request("fax") Session("email") = Request("email")
else
Session("fname") = request("fname") Session("sname") = Request("sname") Session("uname") = Request("uname") Session("pswd") = Request("pswd") Session("addra") = Request("addra") Session("addrb") = Request("addrb") session("county") = Request("county") Session("postcode") = Request("postcode") Session("telno") = Request("telno") Session("fax") = Request("fax") Session("email") = Request("email")
else
Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open = "DRIVER={Microsoft Access Driver (*.mdb)};" & _ "DBQ=" & Server.MapPath("db2.mdb") & ";"
sql1 = "Update users Set fname='" & fname & "', sname='" & sname & "' , uname='" & uname & "', pswd='" & pswd & "', addra='" & addra & "', addrb='" & addrb & "', county='" & county & "', postcode='" & postcode & "', telno='" & telno & "', fax='" & fax & "', email='" & email & "', act='" & act & "' Where userID='" & userID& "'"
MyConn.Execute(sql1)
Conn.close %>
Here is my sode that is inserted int0 HTML page under neath values are displayed in table,
this is what is displayed on my page instead of table I dont understand where I ahve gone wrong as I can insert and read from same table using same recordset why is now being treated differently
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
/userupdateverification.asp, line 340
Thanks for any help offered. Peace
|