navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Passing Autonumber

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Passing Autonumber
Page: [1]
 
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

 
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Passing Autonumber - 1/2/2002 21:53:39   
Whats the rest of the DB code?

§þððk¥
Database / DRW Q & A
VP-ASP Shopping cart
Spooky Login

(in reply to xterradane)
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&'"
%>


 

(in reply to xterradane)
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

(in reply to xterradane)
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?

 

(in reply to xterradane)
Mojo

 

Posts: 2431
From: Chicago
Status: offline

 
RE: Passing Autonumber - 1/3/2002 11:09:35   
Try:

Response.Redirect "Invoice.asp?ID="&NewID

Joe




(in reply to xterradane)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Passing Autonumber - 1/3/2002 13:11:38   


§þððk¥
Database / DRW Q & A
VP-ASP Shopping cart
Spooky Login

(in reply to xterradane)
xterradane

 

Posts: 143
From: Mobile, AL USA
Status: offline

 
RE: Passing Autonumber - 1/3/2002 13:16:30   
Thanks, that worked great!

 

(in reply to xterradane)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Passing Autonumber
Page: [1]
Jump to: 1





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