
March 27th, 2001, 05:43 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
ASP/Access Recordset.Addnew help
<i><b>Originally posted by : Errol (errol78@cccnj.net)</b></i><br /><br />Could anyone tell me what's wrong with this portion of my code. It's my 2nd or 3rd day using asp and I can't seem to get it right. I'm getting an error page can't be displayed when my code hits these lines and I believe it has to do with the .addnew method.<br /><br /> RS_SearchExistingUserId = "Select * From UserInfo Where UserId='" & Session("Session_UserID") & "' "<br /> Set RS = Server.CreateObject("ADODB.Recordset")<br /> RS.CursorType = adOpenDynamic<br /> RS.CursorLocation = adUseClient<br /> RS.Open RS_SearchExistingUserId, Application("Application_DBConn")<br /> If RS.EOF then<br /> RS.AddNew <br /> RS("UserId") = Session("Session_UserID")<br /> RS("UserPwd") = Session("Session_UserPwd")<br /> RS("FirstName") = Session("Session_FirstName")<br /> RS("LastName") = Session("Session_LastName")<br /> RS("EmailAddress") = Session("Session_EmailAddress")<br /> RS.Update<br /> RS.Close<br /> Response.Redirect("/index.asp")<br /> Else<br /> Session("Session_ErrorUserId_Taken") = True<br /> Response.Redirect("login.asp")<br /> End if<br /><br /><br />Thanks for the help all!
|