aseelbathery
12-28-2006, 02:29 AM
When I'm executing this code i get following error. can anybody help me?
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/session/Register.asp, line 28
Here's my code..
<!--#include file="adovbs.asp" -->
<!--#include file="DBConnecter.asp" -->
<% Response.Buffer = True %>
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma" , "no-cache"
Response.Expires = -1
Dim pwd
Dim userid
userid = Request.Form("uname")
pwd = Request.Form("pwd")
If userid <> "" Then
If pwd <> "" Then
Dim Ors
Set Ors = Server.CreateObject("Adodb.Recordset")
Ors.Open "SELECT * FROM table_session WHERE uid = '"&userid&"'",cnnDB,3
If Ors.RecordCount > 0 Then
Response.Write "Sorry! This user name is already taken"
Set Ors = Nothing
Set cnnDB = Nothing
Else
Dim records
cnnDB.Execute "INSERT INTO table_session(uid,password) VALUES" & _
"('" & userid & "','" & pwd & "')" , records
If resords = 1 Then
Response.Write "You Have Been registered Successfully!"
Set Ors = Nothing
Set cnnDB = Nothing
Session("UID") = userid
Response.Redirect "Default.asp"
Response.End
Else
Response.Write Err.Description
Set Ors = Nothing
Set cnnDB = Nothing
Response.End
End If
End If
Else
Response.Write "Password Should not be Empty!"
End If
End If
%>
<html>
<head>
<title>Register</title>
<script language="JavaScript">
function callsubmit()
{
if (frm1.pwd.value==frm1.pwdc.value) {
frm1.submit();
}
else
{
alert("Password Doesn't match. Please Try again");
}
}
</script>
</head>
<body>
<form name="frm1" method="post" id="frm1">
<p>
Login ID: <input type="Text" id="uname" name="uname">
Password: <input type="Password" id="pwd" name="pwd">
Confirm Password: <input type="Password" id="pwdc" name="pwdc">
</p>
<input type="Button" id="submit1" value="Register" name="submit1" onclick="callsubmit()">
</form>
</body>
</html>
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/session/Register.asp, line 28
Here's my code..
<!--#include file="adovbs.asp" -->
<!--#include file="DBConnecter.asp" -->
<% Response.Buffer = True %>
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma" , "no-cache"
Response.Expires = -1
Dim pwd
Dim userid
userid = Request.Form("uname")
pwd = Request.Form("pwd")
If userid <> "" Then
If pwd <> "" Then
Dim Ors
Set Ors = Server.CreateObject("Adodb.Recordset")
Ors.Open "SELECT * FROM table_session WHERE uid = '"&userid&"'",cnnDB,3
If Ors.RecordCount > 0 Then
Response.Write "Sorry! This user name is already taken"
Set Ors = Nothing
Set cnnDB = Nothing
Else
Dim records
cnnDB.Execute "INSERT INTO table_session(uid,password) VALUES" & _
"('" & userid & "','" & pwd & "')" , records
If resords = 1 Then
Response.Write "You Have Been registered Successfully!"
Set Ors = Nothing
Set cnnDB = Nothing
Session("UID") = userid
Response.Redirect "Default.asp"
Response.End
Else
Response.Write Err.Description
Set Ors = Nothing
Set cnnDB = Nothing
Response.End
End If
End If
Else
Response.Write "Password Should not be Empty!"
End If
End If
%>
<html>
<head>
<title>Register</title>
<script language="JavaScript">
function callsubmit()
{
if (frm1.pwd.value==frm1.pwdc.value) {
frm1.submit();
}
else
{
alert("Password Doesn't match. Please Try again");
}
}
</script>
</head>
<body>
<form name="frm1" method="post" id="frm1">
<p>
Login ID: <input type="Text" id="uname" name="uname">
Password: <input type="Password" id="pwd" name="pwd">
Confirm Password: <input type="Password" id="pwdc" name="pwdc">
</p>
<input type="Button" id="submit1" value="Register" name="submit1" onclick="callsubmit()">
</form>
</body>
</html>