sbbrown9924
Technical User
Resources:
Windows XP/IIS 5.0/Access/vbscript/asp/Dreamweaver MX2004.
I am using a command (stored procedure) within an asp page so that I can write to multiple databases (there is another INSERT INTO in the same page). The command looks like this:
<%
if(Request.Form("FirstName") <> "") then Command1__strFirstName = Request.Form("FirstName")
%>
<%
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_HCAP_STRING
Command1.CommandText = "INSERT INTO HCAP (FirstName,Status) VALUES ('" + Replace(Command1__strFirstName, "'", "''") + "','NOT SEEN') "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
I've also handwritten this with the same result:
Insert into HCAP (FirstName,Status) Values('Request.Form("FirstName"),'NOT SEEN')
The result is that the literal "NOT SEEN" gets written to a new record in the HCAP database but the form data in field FirstName (this is both form field name and hcap table field name) does not. I am having no problem writing literals, its just the form data. Any suggestions?
Windows XP/IIS 5.0/Access/vbscript/asp/Dreamweaver MX2004.
I am using a command (stored procedure) within an asp page so that I can write to multiple databases (there is another INSERT INTO in the same page). The command looks like this:
<%
if(Request.Form("FirstName") <> "") then Command1__strFirstName = Request.Form("FirstName")
%>
<%
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_HCAP_STRING
Command1.CommandText = "INSERT INTO HCAP (FirstName,Status) VALUES ('" + Replace(Command1__strFirstName, "'", "''") + "','NOT SEEN') "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
I've also handwritten this with the same result:
Insert into HCAP (FirstName,Status) Values('Request.Form("FirstName"),'NOT SEEN')
The result is that the literal "NOT SEEN" gets written to a new record in the HCAP database but the form data in field FirstName (this is both form field name and hcap table field name) does not. I am having no problem writing literals, its just the form data. Any suggestions?