Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic 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 January 9th, 2004, 11:19 AM
Authorized User
 
Join Date: Jan 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mulit Lookup table ASP form

I have been tasked to create an interface in Asp that allows a user to select a table or tables and insert new, modify, or delete records. The only problem is that this program should be univeral meaning that it shouldnt be tied with just one lookup table the user should select for instance "products" and be able to modify the "products" table or choose "Products Category" and be able to modify that table. Can someone point me in the right direction has to how to get started with this or have any source code for this kind of project. Has anyone used the ADOX.Catalog object? Should I start there? What are the draw backs from this solution as opposed to just creating an ASP page for each table I want to edit.

 
Old January 9th, 2004, 01:42 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The main drawback would be that you'd have to create one page for every table. :) But also that if someone adds a table, you'll have to add a new page.

What database system are you using?

There are many existing products that will already do all this. For example (I can't believe I remember the name!): http://www.aspgrid.com/

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old January 9th, 2004, 01:56 PM
Authorized User
 
Join Date: Jan 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using SQL Server 2000. Would you happen to have any source code or sample app.

 
Old January 16th, 2004, 12:57 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

Perhaps you could request a value from a previous page that you can use to determine what table to lookup. (I wouldn't recommend passing the table name itself.)

MyTable = request("MyTable")
if MyTable = "Table1" then ThisTable = "Products"
if MyTable = "Table2" then ThisTable = "ProductCategories"

set rs = server.createobject("adodb.recordset")
sql = select * from " & ThisTable
rs.open sql, cn, 3, 3

 
Old January 16th, 2004, 01:06 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

One more thing:
If the whole thing is from ASP, I would think that you would need either different forms that apply to each table or a dynamic form that loads up options based on what table is selected.

Also, you might wind up with as many as four pages for the whole procedure; 1) First page to select the desired table. 2) Second page to list the records in the selected table and be able to select a record to edit or delete, as well as a link to add a new record. 3) Third page to load a form that is populated with the detail for the selected record, whereby you can modify it. 4) Fourth page to process whatever the action was that you desired. If it was edit or add then it would modify or append a record. If it was delete then it would delete the record.






Similar Threads
Thread Thread Starter Forum Replies Last Post
lookup value in table Vince_421 Access 16 February 13th, 2007 08:15 AM
Retrieve info about Lookup RowSource for a table c Proteus_3k Pro VB Databases 0 December 2nd, 2004 07:05 AM
Lookup (Dispatch) Table CNewbie C++ Programming 5 November 2nd, 2004 04:12 PM
Lookup Table Problem mikericc Access VBA 2 January 19th, 2004 07:11 PM
lookup table current field. Squid Access 0 December 21st, 2003 07:08 PM





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