Forum Moderators: open

Message Too Old, No Replies

ASP / Acces errors

         

SWiG

2:45 am on Mar 25, 2002 (gmt 0)



I keep getting a syntax error and can't for the life of me figure out what it is. The sequel statement appears to be right as well.

<html>
<head></head>
<title></title>

<!-- #include file="open.asp" -->

<%

If Request.Form("submit") = "Add" OR Request.Form("submit") = "Delete" Then

If Request.Form("submit") = "Add" Then
strSQL = "INSERT INTO tblEmployers (firstName, lastName, companyName, emailAddress, password) " & _
"VALUES ('"&Request.Form("firstName")&"', '"&Request.Form("lastName")&"', '"&Request.Form("companyName")&"', '"&Request.Form("emailAddress")& _
"', '"&Request.Form("password")&"')"
End If

If Request.Form("submit") = "Delete" Then
strSQL = "DELETE FROM Solicitations WHERE solID="&Request.Form("ID")&";"

End If
Set objAdd = Server.CreateObject("ADODB.Command")
objAdd.ActiveConnection = strConn
objAdd.CommandText = strSQL
objAdd.Execute
Set objAdd = Nothing
'Response.write(strSQL)

End If
%>

<form method="post" action="trial2.asp">

<table cellspacing="0" cellpadding="3" border="0">
<tr>
<th>First Name</th>
<td><input type="text" size="50" name="firstName" ></td>
</tr>
<tr>
<th>Last Name</th>
<td><input type="text" size="50" name="lastName" ></td>
</tr>
<tr>
<th>Company Name</th>
<td><input type="text" size="50" name="companyName"></td>
</tr>
<tr>
<th>Email Address</th>
<td><input type="text" size="50" name="emailAddress"></td>
</tr>
<tr>
<th>Password</th>
<td><input type="text" size="50" name="password"></td>
</tr>
<tr>
<td width="100%" colspan="2"><div align="center"><input type="submit" value="Add" name="submit"> <input type="submit" value="Delete" name="submit"></div></td>
</tr>
</table></form></div>

<!-- #include file="close.asp" -->

</body>
</html>

SWiG

4:32 am on Mar 25, 2002 (gmt 0)



I got it figured out. If anyone wants to know DO NOT USE THE WORD "password"

SWiG

txbakers

9:09 pm on Mar 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are quite a few of those keywords that I ran into with ASP coding. If I get strange errors, I will usually check my column names first before hacking into my code.

So many times I had used reserved words by accident.