Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
|
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 13th, 2004, 08:28 AM
Authorized User
 
Join Date: Jun 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to dorothee
Default

ok.
Search page by ID. then show records page, then hyperlink to details page if the record exists or new details page if it doesnot. Either way, choose the device type. if the device type is a pc, it redirects to pc.aspx. now if the pc dataset has a record, it will show the details. if it hasn't got anything it will just show the ID created previously.
that would be an insert if there's no details and that would be an update if some fields are updated.

I know I am not too logical 'cos I am a girl. but.. I am trying...

 
Old June 13th, 2004, 09:01 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Right, I see (partially; I am still not sure what kind of app you're building. I tend to find "Either way, choose the device type. if the device type is a pc, it redirects to pc.aspx. now if the pc dataset has a record, it will show the details. if it hasn't got anything it will just show the ID created previously." to be quite abstract. But that doesn't really matter).

There may be other ways to do this with the Dreamweaver server behaviors, but personally, I think I'd go for a custom solution.

Here's what you should do:

1. Create a new ASPX page
2. In Page_Load, retrieve the PC based on the incoming ID parameter.
3. Try to retrieve the associated record (at least, that's how I understand it is supposed to work). If it exists, save that record's ID to a hidden field in the page, and prepopulate the controls with the record's values. If it doesn't exist leave the hidden ID empty, and display empty controls.
4. In the click event of the Save button, look at the hidden ID field. If it's empty, perform an Insert, otherwise perform an Update against your datasource.

By dropping the DW behaviors, you have full control over what you're doing. It may be a bit more work at first, but I am convinced you'll end up with a page that is much easier to extend and maintain.


Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a new record between two existing records hsncompany BOOK: Beginning Access 2003 VBA 0 April 13th, 2008 03:36 PM
insertion of records in database MunishBhatia SQL Server 2005 1 December 12th, 2006 09:25 PM
Check For Existing Folders & Files zandermax Access VBA 2 September 30th, 2005 11:43 AM
How to check whether a filie is existing szms VB.NET 2002/2003 Basics 2 December 6th, 2004 03:49 PM
Check for existing record echajmovic Access 1 November 3rd, 2003 08:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.