Hello, I am new to this forum but have read several posts and I thank you for your great assistance. I am stumped right now. I have a user registration form in asp that is set to a form method=registra tion.asp page. i will post my registration.as p page below.
I am hoping this asp page will connect to my access database called registration.md b with a table called registration. however, everytime i submit my registration information, I get an error page that says there is a programming error. I have the SAMS teach yourself ASP 3.0 book and have followed this but am having no luck. Does anyone know why this isn't working. The current page I have listed below is trying to use the dsn-less connection. I also tried the dsn connection but failed there too. Any help would be greatly appreciated. Thanks in advance - Jerry
_______________ _______________ _______________ _______________ ___
I am hoping this asp page will connect to my access database called registration.md b with a table called registration. however, everytime i submit my registration information, I get an error page that says there is a programming error. I have the SAMS teach yourself ASP 3.0 book and have followed this but am having no luck. Does anyone know why this isn't working. The current page I have listed below is trying to use the dsn-less connection. I also tried the dsn connection but failed there too. Any help would be greatly appreciated. Thanks in advance - Jerry
_______________ _______________ _______________ _______________ ___
Code:
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include virtual="/adovbs.inc"-->
<html>
<body>
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=C:\Documents and Settings\MM\Desktop\Website\registration.mdb"
objConn.Open
Dim objRS, bolAlreadyExists
If ((Request.Form("firstname") = "") OR (Request.Form("lastname") = "") _
OR (Request.Form("street") = "") OR (Request.Form("city") = "") _
OR (Request.Form("state") = "") OR (Request.Form("zipcode") = "") _
OR (Request.Form("birthdate") = "") oR (Request.Form("email") = "") _
OR (Request.Form("confirmemail") = "") oR (Request.Form("password") = "") _
OR (Request.Form("confirmpassword") = "") oR (Request.Form("question") = "") _
OR (Request.Form("answer") = "") oR (Request.Form("confirmanswer") = "") _
OR (Request.Form("interest") = "") oR (Request.Form("nonewsemail") = "") _
OR (Request.Form("hearabout") = "")
Response.Write "<a href='registration.html'>"
Response.Write "You must enter values for all the fields."
Response.Write "</a>"
Else
bolAlreadyExists = False
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "registration", objConn, , adLockOptimistic, adCmdTable
Do While Not (objRS.EOF OR bolAlreadyExists)
If (StrComp(objRS("email"), Request.Form("email"), _
vbTextCompare) = 0) Then
Response.Write "<a href='registration.html'>"
Response.Write "Email address already found in table."
Response.Write "</a>
bolAlreadyExists = True
End If
objRS.MoveNext
Loop
If Not bolAlreadyExists Then
objRS.AddNew
objRS("firstname") = Request.Form("firstname")
objRS("lastname") = Request.Form("lastname")
objRS("street") = Request.Form("street")
objRS("city") = Request.Form("city")
objRS("state") = Request.Form("state")
objRS("zipcode") = Request.Form("zipcode")
objRS("birthdate") = Request.Form("birthdate")
objRS("email") = Request.Form("email")
objRS("confirmemail") = Request.Form("confirmemail")
objRS("password") = Request.Form("password")
objRS("confirmpassword") = Request.Form("confirmpassword")
objRS("question") = Request.Form("question")
objRS("answer") = Request.Form("answer")
objRS("confirmanswer") = Request.Form("confirmanswer")
objRS("awardprogram") = Request.Form("awardprogram")
objRS("accountnumber") = Request.Form("accountnumber")
objRS("interest") = Request.Form("interest")
objRS("nonewsemail") = Request.Form("nonewsemail")
objRS("hearabout") = Request.Form("hearabout")
objRS.Update
Response.Write "Thank you for registering."
End If
objRS.Close
Set objRS = Nothing
End If
objConn.Close
Set objConn = Nothing
%>
</body>
</html>
Comment