I have a simple subroutine that is working fine for inserting multiple entries from a loop, into a single field in the MS-SQL table:
[tt]Sub AddRecord( value )
DataConn.Execute = "INSERT into services (ID, type) " &_
"VALUES (" & Session("ID"
& ", " & value & "
"
End Sub[/tt]
But I want it to insert values for two fields and it refuses to do it!
[tt]Sub AddRecord( value, fee )
DataConn.Execute = "INSERT into services (ID, type, fee) " &_
"VALUES (" & Session("ID"
& ", " & value & ", " & fee & "
"
End Sub[/tt]
I am looping through the recordset like this:
[tt]rslookup.MoveFirst
do while not rslookup.EOF
ID = rslookup("ID"
Fee = Request("Fee"
If Request(ID) = 1 then
AddRecord ID, FEE
End if
rslookup.MoveNext
loop[/tt]
I've tried it both with parenthesis: AddRecord(ID, FEE) and without: AddRecord ID, FEE
With them, it crashes and without them, it does not but neither does it insert anything. The original value was from a checkbox while the second one is from a text field and with the change, even the checkbox no longer inserts when it was working before. What do I try next? I've exhaused all I can think of. Don
don@pc-homepage.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT/2000 (only when I have to!)
[tt]Sub AddRecord( value )
DataConn.Execute = "INSERT into services (ID, type) " &_
"VALUES (" & Session("ID"
End Sub[/tt]
But I want it to insert values for two fields and it refuses to do it!
[tt]Sub AddRecord( value, fee )
DataConn.Execute = "INSERT into services (ID, type, fee) " &_
"VALUES (" & Session("ID"
End Sub[/tt]
I am looping through the recordset like this:
[tt]rslookup.MoveFirst
do while not rslookup.EOF
ID = rslookup("ID"
Fee = Request("Fee"
If Request(ID) = 1 then
AddRecord ID, FEE
End if
rslookup.MoveNext
loop[/tt]
I've tried it both with parenthesis: AddRecord(ID, FEE) and without: AddRecord ID, FEE
With them, it crashes and without them, it does not but neither does it insert anything. The original value was from a checkbox while the second one is from a text field and with the change, even the checkbox no longer inserts when it was working before. What do I try next? I've exhaused all I can think of. Don
don@pc-homepage.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT/2000 (only when I have to!)