Database is undefined.

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Database is undefined.

    I am having a problem on a Coldfusion site. I am getting multiple errors from
    multiple pages and most say this:

    Variable DATABASE_NAME is undefined.
    The error occurred on line 1.
    page: /features/howto.cfm

    However the database is defined in Coldfusion and also works sometimes.
    Sometimes the page loads fine and sometimes it errors out with that error. I
    don't know what is going on, but it is happening on more than one page. Does
    any one know what could be causing something like this? Is it the server? I
    am at a loss and don't know where to begin looking for the problem.

    Please help.

    Lou

    lazerbrains555 Guest

  2. Similar Questions and Discussions

    1. Import Data from flat-database to relational-database
      Before I start I need some tips and pleas excuse my bad english. I have two databases, one is flat and one is a relational database. example ...
    2. NEWBIE HELP Import Data from flat-database to relational-database
      I want to import Data from a simple Database, which contains all Information in one big record into a relational Database and split up the big...
    3. Passing database info to page allow user input then pass into another database
      Hi I really am going crazy! I'm using VBScript, ASP, and SQL My page reminds me of a shopping cart but looking at shopping cart examples has not...
    4. What is an undefined offset? An undefined index?
      I just switched error_reporting to ALL so I could debug my site. I got a huge page full of errors. One of the most common was that in my arrays I'm...
    5. Another user has modified the contents of this table or view; the database row you are modifying no longer exists in the database;
      Hi, I am testing a trigger that and I am getting this error message saying "Another user has modified the contents of this table or view; the...
  3. #2

    Default Re: Database is undefined.

    Would you post the first few lines of code from /features/howto.cfm? What database are you using? Is it possible that someone on the server has the database "open?"
    jdeline Guest

  4. #3

    Default Re: Database is undefined.

    No, no one on the server has the database open. Buut the first few lines of
    code aren't anything special on that page. features/howto.cfm:

    <html>
    <head>
    <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
    <title>TITLE of MY SITE</title>

    <link rel='stylesheet' type='text/css' href='../ac/styles/ac_style.css'>
    <script language="JavaScript" src="../ac/scripts/ac_open.js"></script>
    </head>


    But the error says it occured on line 1. But line 1 is just the <HTML> tag.

    On the tours/transam.cfm it is different:

    <cfquery datasource=ATL name="TourLookup">
    SELECT *
    FROM ztours2005
    WHERE tShortName = 'TransAm'
    ORDER BY tCategory, tName
    </cfquery>

    <html>

    <head>
    <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
    <title>TITLE of MY SITE</title>

    <link rel='stylesheet' type='text/css' href='../ac/styles/ac_style.css'>
    <script language="JavaScript" src="../ac/scripts/ac_open.js"></script>
    </head>


    The error says:

    Variable ATL is undefined.
    The error occurred on line 1.
    page: /features/howto.cfm

    on BOTH of these pages. Exact same error message totally different code. Any
    ideas. It sounds like it is something wrong with the server, but Id on't know.
    Any Ideas?

    Lou

    lazerbrains555 Guest

  5. #4

    Default Re: Database is undefined.

    Try uploading your pages again. It sounds like they may be corrupted on the server.
    jdeline Guest

  6. #5

    Default Re: Database is undefined.

    if ATL is a variable, should it be in # signs? When you write your query:
    <cfquery datasource=#ATL# name="TourLookup">. Where did you defined that
    variable, in application.cfm? Double check for spelling errors, make sure ODBC
    is working...

    cfmlgirl Guest

  7. #6

    Default Re: Database is undefined.

    The datasource should either be "ALT" or "#ALT#" - note double-quotes.
    jdeline Guest

  8. #7

    Default Re: Database is undefined.

    I tried "ATL" and "#ATL#" and got errors everytime when I did that. I uploaded
    a new file up to the server, still the same problem. Someone said it might be
    the ODBC? Is that a possibility? What could be wrong with it?
    Lou

    lazerbrains555 Guest

  9. #8

    Default Re: Database is undefined.

    Oh, and yes I did define it in the main sites Application.cfm file.

    Thanks,
    Lou
    lazerbrains555 Guest

  10. #9

    Default Re: Database is undefined.

    what could be wron with ODBC? - it may not working, doesn't take much to check
    it...

    Like i said before, it is your variable, then it mucst be in #ALT#. can you
    post the line of code where you are defining this variable? thanks

    cfmlgirl Guest

  11. #10

    Default Re: Database is undefined.

    The line of code I have that works intermittently is :

    <cfquery datasource=ATL name="TourLookup">
    SELECT *
    FROM zTours2005
    WHERE tShortName = 'TransAm'
    ORDER BY tCategory, tName
    </cfquery>

    When I do it like this:
    <cfquery datasource="#ATL#" name="TourLookup">
    SELECT *
    FROM zTours2005
    WHERE tShortName = 'TransAm'
    ORDER BY tCategory, tName
    </cfquery>

    It doesn't work at all. Plus I just upgraded the site from Coldfusion 4.5 to
    MX 7 and this code used to work and now it works about half the time. I am not
    sure what is wrong, but if it is my code please let me know. This query also
    sits about the HTML tags in the page. Does that matter?



    lazerbrains555 Guest

  12. #11

    Default Re: Database is undefined.

    well, if this is the error you are getting:

    Variable ATL is undefined.
    The error occurred on line 1.
    page: /features/howto.cfm

    then it's something wrong with they way you set that variable. It should be
    <CFSET ATL = 'NameOfYourDatasource'>

    cfmlgirl Guest

  13. #12

    Default Re: Database is undefined.

    ATL is the name of our datasource. Should I do:

    <cfset ATL='ATL'>
    ?


    lazerbrains555 Guest

  14. #13

    Default Re: Database is undefined.

    so, in your <cfquery datasource=ATL name="TourLookup"> you are using a real
    datasource name? ATL is not a variable? Or you do have defined variable ATL?
    then maybe this tip will haelp:

    [url]http://forta.com/cf/tips/index.cfm?age=1713[/url]

    cfmlgirl Guest

  15. #14

    Default Re: Database is undefined.

    No. You don not need <cfset ATL='ATL'> if it has worked properly in the past.

    Intermittant faults like you describe relating to ODBC connection and DSN
    failures are likely to be the result of poor server management.

    Think about relocating your site onto another server - it may save you a lot
    of headaches in the long run. Am I right in saying you have not received
    definitive support from your hosting company either?

    mx-7 Guest

  16. #15

    Default Re: Database is undefined.

    OK, I took our advice and moved to a new server. But the only problem is that
    it is still happening exactly the same way. Although I am much happier with
    the new company and they have more options and better management controls, so
    it wasn't a total loss. But I am still having the intermittent failures of
    some of my pages with the same error:

    Variable ATL is undefined.
    The error occurred on line 1.
    page: /tours/transam.cfm
    date/time: {ts '2005-07-28 13:28:29'}

    Here is the code in line 1 that is triggering it:

    <cfquery datasource="#Datasource2#" name="TourLookup">
    SELECT *
    FROM ztours2005
    WHERE tShortName = 'TransAm'
    ORDER BY tCategory, tName
    </cfquery>


    But it works about half of the time. Can anyone see anything wrong with this?




    lazerbrains555 Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139