I created this Registration Form , its little primitive , but I am having problems with the insert into statement , I tried every thing , appreciate any help
<HTML><head>
<TITLE>New User Registration</TITLE>
<FORM action = "Register.asp" method="post" id=form1 name=form1
LANGUAGE=javascript onsubmit="return form1_onsubmit()">
First Name
<INPUT type=text NAME=firstname VALUE="" SIZE=25>
Last Name
<INPUT type=text NAME=lastname VALUE="" SIZE=25>
User Name
<INPUT type=text NAME=userid VALUE="" SIZE=15>
Password
<INPUT TYPE=PASSWORD NAME=password VALUE="" SIZE=15>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</FORM></BODY></HTML>
<%@ Language=VBScript %>
<HTML><HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
Dim sSQL,conn,rs
Set conn = Server.CreateObject("ADODB.Connection"
set rs = server.CreateObject("ADODB.Recordset"
'DSN less connection
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.ConnectionString = "Data Source=" & Server.MapPath("login.mdb"
conn.open
strsql = "Select firstname,lastname from TLogin"
set rs = conn.Execute (strsql)
if (rs.BOF)and (rs.EOF) then
sSQL = "Insert into TLogin (Firstname,lastname,username,password) Values" & "('"& Ucase(Request("firstname") & "', '"& Request("lastname" & "', '"& Request("userid" & "', '" & Request("password" & "');"
conn.Execute sSQL,adCmdText
else
SQL = "Delete * from TLogin where username= '" & Request.Form("userid" & "'"
conn.execute(SQL)
end if
sSQL = "Insert into TLogin (Firstname,lastname,username,password) Values" & "('"& Ucase(Request("firstname") & "', '"& Request("lastname" & "', '"& Request("userid" & "', '" & Request("password" & "');"
conn.Execute sSQL,adCmdText
'close the recordset
rs.close
set rs = nothing
'close the connection
conn.close
set conn = nothing
%>
<h2>Your login details have been saved to the database<h2>
<A HREF="login.asp">[Click here to go to login page]</A>
</BODY>
</HTML>
<HTML><head>
<TITLE>New User Registration</TITLE>
<FORM action = "Register.asp" method="post" id=form1 name=form1
LANGUAGE=javascript onsubmit="return form1_onsubmit()">
First Name
<INPUT type=text NAME=firstname VALUE="" SIZE=25>
Last Name
<INPUT type=text NAME=lastname VALUE="" SIZE=25>
User Name
<INPUT type=text NAME=userid VALUE="" SIZE=15>
Password
<INPUT TYPE=PASSWORD NAME=password VALUE="" SIZE=15>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</FORM></BODY></HTML>
<%@ Language=VBScript %>
<HTML><HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
Dim sSQL,conn,rs
Set conn = Server.CreateObject("ADODB.Connection"
set rs = server.CreateObject("ADODB.Recordset"
'DSN less connection
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.ConnectionString = "Data Source=" & Server.MapPath("login.mdb"
conn.open
strsql = "Select firstname,lastname from TLogin"
set rs = conn.Execute (strsql)
if (rs.BOF)and (rs.EOF) then
sSQL = "Insert into TLogin (Firstname,lastname,username,password) Values" & "('"& Ucase(Request("firstname") & "', '"& Request("lastname" & "', '"& Request("userid" & "', '" & Request("password" & "');"
conn.Execute sSQL,adCmdText
else
SQL = "Delete * from TLogin where username= '" & Request.Form("userid" & "'"
conn.execute(SQL)
end if
sSQL = "Insert into TLogin (Firstname,lastname,username,password) Values" & "('"& Ucase(Request("firstname") & "', '"& Request("lastname" & "', '"& Request("userid" & "', '" & Request("password" & "');"
conn.Execute sSQL,adCmdText
'close the recordset
rs.close
set rs = nothing
'close the connection
conn.close
set conn = nothing
%>
<h2>Your login details have been saved to the database<h2>
<A HREF="login.asp">[Click here to go to login page]</A>
</BODY>
</HTML>