This is a discussion on "page error number 2!!" within the Classic ASP section. This forum, and the thread "page error number 2!! are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
page error number 2!!
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
page error number 2!!
ok, i have inc_menu.asp, which has this code for the first few lines:
|
|
|
|
||||
|
in fact, just checked it out, and its where any connection to the database occurs
|
|
|||
|
|
||||
|
I think what *may* be happening Ben, is that your database is not being found.
I would do as Smokie suggests, and set up a system DSN. I'm sure you host will allow for a DSN.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
||||
|
the problem may be that you're using a physical path to find the database.
e.g.: let's say you database is at the root of your site. so: www.yoursite.com/data.mdb server.mappath("data.mdb") returns: www.yoursite.com/data.mdb if you view a page on the root of your site, it works fine. e.eg: www.yousite.com/index.asp but if you include the inc_menu.asp file in a page within a folder, e.g: www.yoursite.com/help/inc_menu.asp then you'll get an error because the server.mappath("data.mdb") function will now return: www.yoursite.com/help/data.mdb and your database won't be found.... if that's the problem, just use a virtual path server.mappath("/data.mdb") and it will always point to the root....
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
||||
|
Thats good advice spinal. To add to it though, I would still recommend using a system DSN, or least moving the database out of the root into an obcurely named folder... similarly give the database an obscure name.
Having a DB called data.mdb in your root is about as unsecure as it gets.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
||||
|
let me try this one.....
Data Source Name is a key registered on the server which stores the physical path of your database. so you'd use: DSNtemp = "Provider=Microsoft.Jet.OLEDB.4.0;DSN=MyMenuDatabase" where "MyMenuDatabase" holds the path to your database right?
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
||||
|
Yes Spinal.... essentially, this is correct. You Hosting company usually makes provision for setting up DSN's.
Log-in to your domain control panel to access it. If you dont have the option, then email them.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Its like storing your connection string on the server.
Spinal, i dont think you connect to it like that, i have always done it like this: DSNTemp = "DSN=MyDSN" I dont think you need to specify the provider because you choose the provider when you setup the DSN on the server. |
|
||||
|
Well spotted Mr Connection String
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
||||
|
I wouldn't know coz I don't use DSN but I was just trying to get the concept accross.
either way, please accept my most sincere appology dear lord of all connection strings. I shall never fail you again. :wink:
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
||||
|
lol
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
![]() |
| Tags |
| page, error, number |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Keep getting error message Microsoft VBScript runtime error '800a01a8' | cpando1974 | Classic ASP | 2 | Aug 7th, 2007 12:00 |
| number of php includes on one page? | Lchad | PHP Forum | 7 | Apr 4th, 2007 22:01 |
| Error Page / .htaccess Problem | lucidspoon | PHP Forum | 0 | Dec 21st, 2005 20:41 |
| Remove page number | malambing57 | Classic ASP | 1 | Oct 14th, 2004 08:47 |
| page error | benbacardi | Classic ASP | 11 | Sep 27th, 2004 17:01 |