
March 27th, 2000, 08:55 AM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 24
|
|
|
<i><b>Originally posted by : steve</b></i><br />strSampleValue = request("afieldfromform")<br />strsql3 = ""<br />strSQL3 = "INSERT INTO tblName(tblName.Value1, tblName.Value2) "<br />strSQL3 = strSQL3 & " SELECT "<br />strSQL3 = strSQL3 & "'" & strSampleValue & "' as text1, " <br />strSQL3 = strSQL3 & " request.form("somefieldwithnumbers") & " as text2 "<br /><br />here is some sample code using variables.<br /><br /><br />------------<br />Paul at 3/27/2000 5:07:28 AM<br /><br />How do you use variables in an SQL string?<br /><br />The ID I have is stored in a variable called "thisdelegateid".<br /><br />How do I use this as a value in an SQL string to populate a table?<br /><br />i.e.<br /><br />SQL2 = "INSERT into Registration ([Conference Code], [Delegate ID]" &_ <br />"[Internet Reg], [Paying Organisation ID], MeetingFeesCode, " & _<br />"[Name Required]) VALUES ('ITMA 13th Annual Meeting', " &_<br />??????????, True, '" & _<br />Request.Form("txtPaying") & "','" & _<br />Request.Form("cboFees") & "','" & _<br />Request.Form("txtName") & "')" <br /><br />the variable "thisdelegateid" is a number.<br /><br />Any help any one could give me would be greatly appreciated <br /><br />Thanks<br /><br />Paul<br />
|