Results 1 to 6 of 6

Thread: Simple question

  1. #1

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Simple question

    Where should I declare global const in ASP?

    Let said, I have a const Const DbSvrName = "localhost" in each ASP page. and I take a long time to change each when I change the database server IP.

    Therefore, where should I declare this constant. So it can access by each ASP page.

    regards,

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    set it in the global.asa file.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Thanks, Memnoch1207

  4. #4
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    Or keep it in include file.

    anypage.asp
    Code:
    <html>
    <head></head>
    <!--#include file="hostname.inc"-->
    <body>
    ....
    ....

    hostname.inc
    Code:
    <%
    Const DbSvrName = "localhost"
    %>
    Visit my PROJECTS @ www.asprojects.com

  5. #5

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Memnoch1207: It working fine in my development pc (localhost), but when I upload to the webhosting server, it doesn't work. It is require any special setting on the server side?

    andreys: Will try your suggestion.

    regards,

  6. #6

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    andreys : the include method working in both the web server and my loacal development machine.

    Thanks both you guys

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width