CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Show document based on parameter value.

Print topic Send  topic

Author Message
sappie

Posts: 13
Posted: 10/16/2006, 1:57 AM

Hello,

Probabbly a simple question, but can't find the answer on the forum (nor anywhere else).
I would like page to show a document from the database, based on the parametervalue given in the URL.
Example:
URL = http://...../Documents?DocId=12
Shown page (document) = http://..../Doc/Example.DOC

The document Example.DOC is the document name stored in the database with "DocId" = 12.

How can I achieve this?

Greeting,
H. Dröge
View profile  Send private message
robertmann

Posts: 109
Posted: 10/16/2006, 6:46 AM

sappie,

You should create an empty page with this code in AfterInitialize
Dim Connection  
Set Connection = New clsDBYourConnectioName  
Connection.Open  
Redirect = CCDLookUp("document_name","documents","DocId=" & CCGetParam("DocId","0"), Connection)  
Connection.Close  
Set Connection = Nothing
YourConnectioName needs to be your real connection name. Same with field and table names.
_________________
Robert
View profile  Send private message
sappie

Posts: 13
Posted: 10/16/2006, 6:49 AM

Hello Robert,

Just a minute ago I was trying a similar solution. Combinedwith a 'redirect' it indeed gives the desired result!
Thanks for your help!

Sappie.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.