If Request Command submitting values

From: Paul (delete007_at_blueyonder.co.uk)
Date: 12/16/04


Date: Thu, 16 Dec 2004 05:39:59 GMT

Hi all, I'm using the "If Request" command to submit data from a form to a
database only when the form is submitted. But for some reason the form data
is submitted to the database on page load. Causing a problem because the
values submitted are null.

Q1) Can anyone look at the code and tell me how to prevent this?

<% If Request("SubmitVehicle") <> "" Then %>
<%AddVehicle__StrVehicle = Request("Vehicle")%>
<% End If %>

<%

set AddVehicle = Server.CreateObject("ADODB.Command")
AddVehicle.ActiveConnection = MM_CertainCars_STRING
AddVehicle.CommandText = "INSERT INTO TestVehicleTable (Vehicle,
VehicleValue) VALUES ('" + Replace (AddVehicle__StrVehicle, "'", "''") +
"','" + Replace(AddVehicle__StrVehicle & "Model", "'", "''") + "') "
AddVehicle.CommandType = 1
AddVehicle.CommandTimeout = 0
AddVehicle.Prepared = true
AddVehicle.Execute()

%>



Relevant Pages

  • compiler and metadata, request opinions...
    ... a lot of the upper/middle compiler machinery is still lacking (such as ... embed the metadata directly into the object modules (the reason being that ... request for a particular piece of information is embedded in a symbol (sort ... it will be loaded into an in-memory version of the database. ...
    (comp.compilers)
  • misc: compiler and metadata...
    ... a lot of the upper/middle compiler machinery is still lacking (such as ... embed the metadata directly into the object modules (the reason being that ... request for a particular piece of information is embedded in a symbol (sort ... it will be loaded into an in-memory version of the database. ...
    (comp.lang.misc)
  • Re: Placing a hyperlink on a webpage to my secure database
    ... a request without a lot of maintainance. ... I'm in the process of deploying the desktop shortcut to our department ... > line (you could type it in from the command line). ... > (Jet is the underlying default database engine for Access.) There's no ...
    (microsoft.public.access.security)
  • Re: privacy problem: urgent for all
    ... The post doesn't look like it is from Art. ... requiring you to snail mail your request to be eliminated. ... database, which also includes addresses, phone numbers and birth ... "It is useless to attempt to reason a man out of what he was never ...
    (soc.retirement)
  • Re: ADTPro 1.1.2 Released
    ... underground and that lead me to another request: if a send command is ... aborted for whatever reason, if you perform it again then the filename ...
    (comp.sys.apple2)

Loading