|
| |
|
|
xterradane
Posts: 143 From: Mobile, AL USA Status: offline
|
Passing Autonumber - 1/2/2002 21:42:49
I need to submit a form and then use the Access Autonumber to be passed to the next page, I guess as NewPage.asp?ID= But, how do I code it to get the id after adding? I tried using the following, but I must be doing something wrong: rsJob.Update NewID=rsJob(0) Dim strName, strValue For each strField in rsJob.Fields strName = strField.Name strValue = strField.Value Session(strName) = strValue Next Session("blnValidUser") = True rsJob.Close Set rsJob=Nothing Response.Clear Response.Redirect "Invoice.asp?ID='&NewID&'" Thanks, Gail
|
|
|
|
xterradane
Posts: 143 From: Mobile, AL USA Status: offline
|
RE: Passing Autonumber - 1/2/2002 22:00:08
<% Dim rsJob Set rsJob = Server.CreateObject("ADODB.Recordset") rsJob.Open "Job", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable rsJob.AddNew rsJob("EMail") = Session("EMail") rsJob("JobType") = Request.Form("JobType") rsJob("JobTitle") = Request.Form("JobTitle") rsJob("Education") = Request.Form("Education") rsJob("Certification") = Request.Form("Certification") rsJob("JobDescription") = Request.Form("JobDescription") rsJob("Experience") = Request.Form("Experience") rsJob("PayRange") = Request.Form("PayRange") rsJob("Benefits") = Request.Form("Benefits") rsJob("City") = Request.Form("City") rsJob("State") = Request.Form("State") rsJob("Country") = Request.Form("Country") rsJob("ApplicantInstructions") = Request.Form("ApplicantInstructions") rsJob("DatePosted") = Date rsJob("DateExpires") = Date + Request.Form("DaysPosted") rsJob.Update NewID=rsJob(0) Dim strName, strValue For each strField in rsJob.Fields strName = strField.Name strValue = strField.Value Session(strName) = strValue Next Session("blnValidUser") = True rsJob.Close Set rsJob=Nothing Response.Clear Response.Redirect "Invoice.asp?ID='&NewID&'" %>
|
|
|
|
Spooky
Posts: 26599 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Passing Autonumber - 1/3/2002 2:14:09
Try these options : adOpenKeySet, adLockPessimistic, adCmdTable Also, dont use Response.Clear and see how you go. §þððk¥ Database / DRW Q & A VP-ASP Shopping cart Spooky Login
|
|
|
|
xterradane
Posts: 143 From: Mobile, AL USA Status: offline
|
RE: Passing Autonumber - 1/3/2002 10:56:38
Ok, I've done that and now it goes to the next page, adds to database, but in just passes this code: webpub/Invoice.asp?ID='&NewID&' Rather than the ID #, Do I have a quote wrong or something?
|
|
|
|
Mojo
Posts: 2431 From: Chicago Status: offline
|
RE: Passing Autonumber - 1/3/2002 11:09:35
Try: Response.Redirect "Invoice.asp?ID="&NewID Joe
|
|
|
|
xterradane
Posts: 143 From: Mobile, AL USA Status: offline
|
RE: Passing Autonumber - 1/3/2002 13:16:30
Thanks, that worked great!
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|