J
Jack
Hi,
I am trying to get a thorough understanding of a code where a addition or
deletion of records can be done from a list of records. For addition part of
the form, data is being obtained from set of input boxes.
The following is the code being used:
If Len(Request.Form("ID_0"))>0 Then
AuthorID=Request.Form("ID_0")
FName=Request.Form("fName_0")
LName=Request.Form("lName_0")
' SQL will break on names like O'Leary
' if single quotes are not doubled.
LName=Replace(LName,"'","''")
Phone=Request.Form("Phone_0")
Address=Request.Form("Address_0")
City=Request.Form("City_0")
State=Request.Form("State_0")
' Create the UPDATE SQL Statement
sql = " INSERT INTO Authors (au_id, au_fName, "
sql = sql & "au_lName, phone, address, city, state)"
sql = sql & " VALUES('" & AuthorID & "','" & FName
sql = sql & "','" & LName & "','" & Phone
sql = sql & "','" & Address & "','" & City
sql = sql & "','" & State & "')"
' Execute the INSERT SQL
cnnPubs.Execute sql
intCount=1
End if
I am not clear where the 0 suffix is coming from in the following:
AuthorID=Request.Form("ID_0")
FName=Request.Form("fName_0")
Thanks for any help.
I am trying to get a thorough understanding of a code where a addition or
deletion of records can be done from a list of records. For addition part of
the form, data is being obtained from set of input boxes.
The following is the code being used:
If Len(Request.Form("ID_0"))>0 Then
AuthorID=Request.Form("ID_0")
FName=Request.Form("fName_0")
LName=Request.Form("lName_0")
' SQL will break on names like O'Leary
' if single quotes are not doubled.
LName=Replace(LName,"'","''")
Phone=Request.Form("Phone_0")
Address=Request.Form("Address_0")
City=Request.Form("City_0")
State=Request.Form("State_0")
' Create the UPDATE SQL Statement
sql = " INSERT INTO Authors (au_id, au_fName, "
sql = sql & "au_lName, phone, address, city, state)"
sql = sql & " VALUES('" & AuthorID & "','" & FName
sql = sql & "','" & LName & "','" & Phone
sql = sql & "','" & Address & "','" & City
sql = sql & "','" & State & "')"
' Execute the INSERT SQL
cnnPubs.Execute sql
intCount=1
End if
I am not clear where the 0 suffix is coming from in the following:
AuthorID=Request.Form("ID_0")
FName=Request.Form("fName_0")
Thanks for any help.