If Request Command submitting values
From: Paul (delete007_at_blueyonder.co.uk)
Date: 12/16/04
- Next message: Gérard Leclercq: "Re: If Request Command submitting values"
- Previous message: Bob Barrows [MVP]: "Re: How to determine if an ADO Recordset column is required"
- Next in thread: Gérard Leclercq: "Re: If Request Command submitting values"
- Reply: Gérard Leclercq: "Re: If Request Command submitting values"
- Messages sorted by: [ date ] [ thread ]
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()
%>
- Next message: Gérard Leclercq: "Re: If Request Command submitting values"
- Previous message: Bob Barrows [MVP]: "Re: How to determine if an ADO Recordset column is required"
- Next in thread: Gérard Leclercq: "Re: If Request Command submitting values"
- Reply: Gérard Leclercq: "Re: If Request Command submitting values"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|