Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 August 4th, 2007, 10:15 PM
Authorized User
 
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with modulizing for quicker response

My problem is I have 2000-odd pictures to show on indevidual pages and want to grab data from my online database to fill in the detail rather than typing it all in for each picture

I assume (*dangerous*) that I can create an include file to load the database. so I don't have to put in into every script.

But I then want to pass the name of the table and the query to a script and return the result back to my original script that requested it

I can write the script to find the data, my problem is passing and returning to stuff to the right program again I assume I can use
<% StrURL %> so it goes back to where it was requested, it's just the nitty gritty I am having trouble with.

It would be nice if someone can point me to a script that does the same sort of thing, with the rider that I do not want to get involved with Java script.

BTW, is closing the table alright or should I close the database every time

Thanx

Topshed
 
Old August 5th, 2007, 09:26 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Ok I am not sure that I understand what you are tyring to do but here goes.

First and foremost, ALWAYS explicitly close your database connections, otherwise you can wind up with memory leaks and such.

Secondly, yes you can include a file that contains methods to connect to your database, for example, say that you had a method in your include file called ConnectToDatabase on your actual page you would do something like this:

'Some code
ConnectToDatabase()
'some more code

In so far as returning stuff you would need to write some sort of function, for example:

In your include file:
Function doFoo(value1, value2)
  Dim sFooValue
  sFooValue = value1 + value2
  doFoo = sFooValue
End Function

Then on your host page:
Dim sFoo
sFoo = doFoo(1, 2)

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
quicker way to create variables in perl - dynamic? crmpicco Perl 4 March 6th, 2007 07:53 AM
response.redirect sarah lee ASP.NET 1.0 and 1.1 Basics 1 October 27th, 2006 08:57 AM
response.isclientconnected crmpicco Classic ASP Databases 0 March 15th, 2006 04:58 AM
Quicker way of loading thumbnails katsarosj Pro VB.NET 2002/2003 3 June 29th, 2005 09:42 AM
i need a response to my q..:-) noor ASP.NET 1.0 and 1.1 Basics 1 January 14th, 2005 05:10 PM





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