I am a regular VB user and am working on making my code work for ASP as well. I have created the following script that gives me an object required error. Can anyone tell me what I have done wrong?
Also, I have to admit being *very* new to this so if you need more information or if I am asking too much at once, please let me know.Code:<% dim myconnection dim connectstring dim strSQL dim rsCallers dim rsSponsorList dim name dim address dim phone dim sponsorID dim caller dim callerID dim response dim calldate connectstring = "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\SourceCode\VBUG\JobFair.mdb;" set myconnection = server.createobject("ADODB.Connection") set rsCallers = server.createobject("ADODB.Recordset") set rsSponsorList = server.createobject("ADODB.Recordset") myconnection.open connectstring name = request.form("Name") address = request.form("Address") phone = request.form("Phone") calldate = request.form("CallDate") response = request.form("Response") caller = request.form("Caller") strSQL = "insert into Sponsors (Name, Address, Phone) values ('" & name & "', '" & address & "', '"& phone & "')" myconnection.execute(strSQL) strSQL = "" strSQL = "select MAX(SponsorID) as NewID from Sponsors" set rsSponsorList = myconnection.execute(strSQL) sponsorID = rsSponsorList.Fields("NewID").Value strSQL = "" strSQL = "Select CallerID from Callers where CallerName = " & caller set rsCallers = myconnection.execute(strSQL) callerID = rsCallers.Fields("CallerID").Value strSQL = "" strSQL = "insert into CallInfo (SponsorID, CallerID, Response, CallDate) values (" & sponsorID & ", " & callerID & ", '" & response & "', " & calldate & ")" myconnection.execute(strSQL) %>
Thank you!
Eva




Reply With Quote