Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quotation help in VB

Status
Not open for further replies.

E3

IS-IT--Management
Feb 19, 2002
16
SG
Dim RSID
Dim MaxID

Set RSID = CreateObject("ADODB.Recordset")
Set MaxID = CreateObject("ADODB.Recordset")

MaxID = conn.Execute("Select MAX(bidderid)+1 from bidders")

conn.Execute "Insert into bidders(bidderid,biddername, password, " _
& "emailaddress, address, csz, phonenumber) values (" _
& MaxID("bidderid") & "" _
& "'" & TheRequest.Form("Username") & "', " _
& "'" & TheRequest.Form("Password") & "', " _
& "'" & TheRequest.Form("EmailAddress") & "', " _
& "'" & TheRequest.Form("Address") & "', " _
& "'" & TheRequest.Form("CSZ") & "', " _
& "'" & TheRequest.Form("PhoneNumber") & "')"


Set RSID = conn.Execute("Select Max(bidderid) as MaxID " _
& "from bidders")
TheSession("BidderID") = RSID("MaxID")

End Sub


Right now I have having errors in the the line whereby I tried to pass in the recordset "MaxID". Is my quotation right? after the concatenation & , I shouldn't be adding a double quotation since its a variable?

Can some show me the correct way of putting quotes? or the rules?

Error Type:
ADODB.Fields (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/Register_ID.asp, line 7
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top