Home | Advertising Info88 USERS CURRENTLY ONLINE   
   Site Search Contact Us Friday, March 14, 2025  
 
 


 
ASPProtect
User Management Application with web based screens that allow you to manage users.
www.ASPProtect.com
 
ASPBanner
Banner Rotation system. Advertisers can monitor online statistical reports via their web browsers.
www.ASPBanner.com
 
ASP Photo Gallery
Upload an unlimited amount of albums. Set up categories.Image resizing thumbnail creation.
www.ASPPhotoGallery.com
 
ASPClassifieds
Classifieds system. Set up categories. Users can register themselves. Supports picture uploads.
www.ASPClassifieds.com



DISCUSSION ARCHIVES
 



We didn't realize
the site was so popular.

Other Stuff
 

 
 
Active Server Pages ASP control controls class classes module script Scripts applet CJWSoft ASPProtect ASPBanner ASPClassifieds



(Advanced)  (Components)  (Database)  (General)  (Vbscript)




ASPProtect

 
Subject: Re: Inserting to related tables, on different pages
From: Harlan
Date: 3/22/1999 8:52:12 AM
IP: 206.222.20.2



 

I guess my question is (after all this rambling)
1. does this seem like it will work?
-yep I do it all the time, almost exactly as you have described.


2. do i need to save the recordID in a session object, or will passing it as a hidden value from page to page be enough.
-either will work, but hidden fields is generally a better way to do it if you are sure they will
always be using a form to "post/get" the hidden fields onto the next page.

3. if I can grab the recordID value from my new record i just posted, can i also grab values such as username, and location?
-well of course you can both get the id and any
values you want. You will have to do it in a
select statement. There is no way to return a
value from an insert. But its really easy to
get that field, and only that field. Here is
how I do it.. (posted directly from a dll of mine I'm working on now)

sqlTests = "INSERT INTO tests " & _
"(name,typeid,classid) VALUES ('" & _
Trim(strClassName) & "'," & _
intTypeID & ",'" & _
Trim(strClassID) & "')"
'in order to insert into the class table, we have to know
'the classid.. so we have to select the one we just inserted
'back out of the db for its classid..
sqlClassID = "SELECT testid from tests where classid='" & strClassID & "'"
DBOpen 'open the database
DB.BeginTrans
DB.Execute (sqlTests) 'run the insert statement
'run our query
Set rsClassID = DB.Execute(sqlClassID)
'if we don't get back a classID then something is wrong
If rsClassID.EOF And rsClassID.BOF Then
DB.RollbackTrans 'if there is an error at this point, we
'need to rollback our transaction so we don't save 1/2 the test.
createClass = False
errMessage = "Error: " & errUnknown & " :cc0160"
Exit Function
Else 'if we do get back a classID everything is fine.
intTestID = rsClassID("TestID")
End If


note: this is only partial code, don't attempt to use it. Its also not asp, but the concept is the same.

Previous Message


 

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP programs help tutorial tutorials routine routines jobs listserve mailinglist bulletin board bulletin boards programming snippet snippets CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com