i'm currently using a switch case: <% Select Case Request.QueryString("Page") Case "" %><!--#INCLUDE FILE="news.asp" --><% Case "Screenshots" %><!--#INCLUDE FILE="screenshots.asp" --><% Case "Downloads" %><!--#INCLUDE FILE="downloads.asp" --><% Case "Login" %><!--#INCLUDE FILE="login.asp" --><% Case "Logout" %><!--#INCLUDE FILE="logout.asp" --><% End Select %> but in both news.asp and screenshots.asp there are DB connection strings, but i thought that shouldn't be a problem because he will pick only one of the includes at a time. but the stupid thing give error about strings being defined more than once:
Compilatiefout Microsoft VBScript error '800a0411'
Naam is opnieuw gedefinieerd
/screenshots.asp, line 3
Dim adoCon 'Holds the Database Connection Object ----^
How can i bypass this problem, i really don't want to rename the connection strings in one of the parts of my site (news/screenshots) because those both consist of a couple of pages. And i don't know exactly how to make a asp file that correctly includes all the needed strings, because almost every page has a different SQL string...
I solved it, never mind i just did a search and replace action for adoCon and strSQL... added a letter for the news page strings but now i have an other problem Object required: 'rsAddComments' and the strange thing is... it's exactly the same as in an other file (again)
quote:but in both news.asp and screenshots.asp there are DB connection strings, but i thought that shouldn't be a problem because he will pick only one of the includes at a time.
This isn't what happens. All the include files are added to the page code base, since includes are processed before any asp code starts running. The Select is only choosing which section of code to execute, not which include file to include.
anyway it comes down to this: it loads a string/variable twice resulting in an error but i fixed it everything works now i even started an additional page with downloads