View Full Version : Using #include
simplyblue
09-02-2002, 07:48 AM
Hi,
I have 2 #include asp files in my asp page. Both the include files have to query a database and display results. But i get an error ("Name redefined. Const adOpenForwardOnly=0")
I think it's because I defined adovbs in both the files.
Is there anyway I can solve this problem?
Thank you!
only define it in one of the files.
do the two files query the same database ? if so : use 1 include for the connection and use other include(s) for the queying.
(you might want the modify your includes structure into a real modular structure)
simplyblue
09-02-2002, 09:43 AM
I can't define it in only one file as the other file need to connect to the database as well.
Here's what i have:
a db.asp for connection
an adovb.asp included in db.asp
Another page, index.asp where i have to include 2 files, a.asp and b.asp. Both a.asp and b.asp query the same database.
Isn't this a modular structure?
i'm not sure i get this right.
or you including a.asp anb b.asp into index.asp where db.asp is included both in a.asp and b.asp ? (a and b querying the same DB)
if so : take out the db-include from a and b and include it in index.asp before including a and b
you can make multiple query's on 1 (open) connection
(like that you create independent modules : one for db-connection, one for recordset1+query1, one for recordset2+query2, .... if you need query 1 in yet another file, include db.asp before a.asp in that file etc etc)
simplyblue
09-02-2002, 10:09 AM
Thanks for your help raf!
I also realised that I cannot declare variables of the same names in the files, so i got to change the name of some of the variables...
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.