Ask a Question related to Coldfusion Database Access, Design and Development.
-
lazerbrains555 #1
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
-
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 ... -
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... -
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... -
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... -
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... -
jdeline #2
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
-
lazerbrains555 #3
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
-
jdeline #4
Re: Database is undefined.
Try uploading your pages again. It sounds like they may be corrupted on the server.
jdeline Guest
-
cfmlgirl #5
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
-
jdeline #6
Re: Database is undefined.
The datasource should either be "ALT" or "#ALT#" - note double-quotes.
jdeline Guest
-
lazerbrains555 #7
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
-
lazerbrains555 #8
Re: Database is undefined.
Oh, and yes I did define it in the main sites Application.cfm file.
Thanks,
Lou
lazerbrains555 Guest
-
cfmlgirl #9
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
-
lazerbrains555 #10
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
-
cfmlgirl #11
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
-
lazerbrains555 #12
Re: Database is undefined.
ATL is the name of our datasource. Should I do:
<cfset ATL='ATL'>
?
lazerbrains555 Guest
-
cfmlgirl #13
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
-
mx-7 #14
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
-
lazerbrains555 #15
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



Reply With Quote

