Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Switch Case problem with DB
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

PuppyF500
New Member

Netherlands
68 Posts

Posted - 10 December 2004 :  07:36:23  Show Profile
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...

Edited by - ruirib on 10 December 2004 11:29:19

Jorrit787
Average Member

Netherlands
681 Posts

Posted - 10 December 2004 :  08:23:08  Show Profile  Visit Jorrit787's Homepage  Send Jorrit787 an AOL message  Send Jorrit787 a Yahoo! Message
Maybe you should translate the script error you get, in order for people to be able to understand what it says...

eXtremeGossip
Go to Top of Page

PuppyF500
New Member

Netherlands
68 Posts

Posted - 10 December 2004 :  09:15:03  Show Profile
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)
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 10 December 2004 :  17:38:07  Show Profile
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.

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page

PuppyF500
New Member

Netherlands
68 Posts

Posted - 10 December 2004 :  19:52:34  Show Profile
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.7 seconds. Powered By: Snitz Forums 2000 Version 3.4.07