
May 2nd, 2008, 02:03 PM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 1
Time spent in forums: 22 m 49 sec
Reputation Power: 0
|
|
|
Syntax error (missing operator) in query expression 'Zip_Code ='
Hi everyone,
I have a problem that I cannot seem to track down... this one has me baffled, or maybe I am just missing something simple. Any help would be greatly appreciated.
Thanks very much,
Jim
Here is the error:
Syntax error (missing operator) in query expression 'Zip_Code ='
Now here is a chunk of my code:
Code:
<!--#include file="config.asp"-->
<% if request.form("submit") <> "" then
qs = "?page=" & request.querystring("page") & "&order=" & request.querystring("order")
Set asplconn = Server.CreateObject("ADODB.Connection")
asplconn.Open dbconn
select case request.form("submit")
case "Add New","Update"
set rsLatLon = asplconn.execute("select * from aspL_Zips where Zip_Code = " & request.form("Zip"))
if not rsLatLon.eof then
Lat = rsLatLon("Zip_Lat")
Lon = rsLatLon("Zip_Lon")
end if
rsLatLon.Close
set rsLatLon = nothing
Set rsLocations = CreateObject("ADODB.Recordset")
if request.form("submit") = "Add New" then
strSQL = "select * from aspL_Locations where Location_Id = 0"
else
strSQL = "select * from aspL_Locations where Location_Id = " & request("location")
end if
rsLocations.Open strSQL, asplconn, 1, 3
if request.form("submit") = "Add New" then
rsLocations.AddNew
end if
rsLocations("Location_Name") = request.form("Name")
rsLocations("Location_Address") = request.form("Address")
rsLocations("Location_City") = request.form("City")
rsLocations("Location_State") = request.form("state")
rsLocations("Location_Zip") = request.form("Zip")
rsLocations("Location_Phone") = request.form("Phone")
rsLocations("Location_Fax") = request.form("Fax")
rsLocations("Location_Email") = request.form("Email")
rsLocations("Location_Website") = request.form("Website")
rsLocations("Location_Lat") = Lat
rsLocations("Location_Lon") = Lon
rsLocations.Update
rsLocations.Close
set rsLocations = nothing
if request.form("submit") = "Add New" then
session("asplmsg") = "New location successfully added."
else
session("asplmsg") = "Location successfully updated."
end if
case "Remove"
set rsDelete = asplconn.execute("select * from aspL_Locations where location_id = " & request.querystring("location"))
if not rsDelete.eof then
asplconn.execute("delete from aspL_Locations where location_id = " & request.querystring("location"))
session("asplmsg") = "The selected location was removed."
else
session("asplmsg") = "There was a problem removing the selected location."
end if
rsDelete.Close
set rsDelete = nothing
end select
asplconn.Close
set asplconn = nothing
response.redirect "admin.asp" & qs
end if %>
|