Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

plz help- newbie

Status
Not open for further replies.

Goat

Programmer
Jul 13, 2000
36
DK
Greetings

My situation is this: I have been give the job of revamping a website. Most of which is done. I also have to move the site to a new server. Part of the site includes a Access database which is interfaced with cold fusion. Please take a look a the existing db/cfml:

I have on my local computer the Cold Fusion Server 5 and PWS running in order to test. I have downloaded what I believe to me all the nessary files from the old site. I have also set up a system DNS which is 'wdbase'. But when I test it loally I get this error:

Error Occurred While Processing Request
Error Diagnostic Information

An error occurred while evaluating the expression:


"#wdbase#"



Error near line 59, column 44.
--------------------------------------------------------------------------------

Error resolving parameter WDBASE


ColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either:

You have misspelled the parameter name, or
You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.


The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (59:1) to (59:52).


Date/Time: 01/29/02 15:43:15
Browser: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Remote Address: 127.0.0.1


---------------------

Please - if someone could take a look at the above link and tell me what I might be doing wrong.
I have a deadline of tomorrow to get it finished too - so I'm freaking out!

Thanks so very much.
 
First, can you get into the Cold Fusion administrator and verify the connection to the database?

Second, if you post the piece of code that is giving you trouble, someone here can probably help you. But, I'll mention a couple of common things I have done that have given me trouble.

Whenever you access a CF variable, it must be inside a set of CFOUTPUT tags. If the variable is one that is returned from a query, you must give the query name in the CFOUTPUT tag. Here is an example:

<CFQUERY NAME=&quot;GetProductInfo&quot;
DATASOURCE=&quot;#Application.Datasource#&quot;
DBTYPE=&quot;ODBC&quot;>
SELECT *
FROM ProductTable
WHERE ProdID = '#URL.Product#'
</CFQUERY>

Is wdbase supposed to be an Application varible? If so, it would be defined on a page called Application.cfm.

Also, make sure #wdbase# has a value. You can check this by inserting a line like this:

<CFOUTPUT>#wdbase#</CFOUTPUT>
<CFABORT>

This will tell you what the value of #wdbase# is. The <CFABORT> simply stops processing at whatever point you put it. You may need to stop the processing to see the variable value.

Just a few ideas. Let us know. Calista :-X
Jedi Knight,
Champion of the Force
 
Thanks heaps Calista for your response!!!!

Firstly, beacause it is working fine on the old site I'm pretty sure there is nothing wrong with the code.

I tried the:
<CFOUTPUT>#wdbase#</CFOUTPUT>
<CFABORT>

and I got and error. It didnt understand what 'wdbase' is.

But I did find this was rumaging around in the code:
<cfquery name=&quot;category_list&quot; datasource=&quot;#wdbase#&quot; dbtype=&quot;ODBC&quot;>
SELECT DISTINCT Category
FROM TBLCategory
WHERE ((Category) Is Not Null)
ORDER BY Category;
</cfquery>

This tells me that 'wdbase' is the system dns - would that be correct?

And I checked with the cold fusion server - and verified the odbc setting for 'wdbase'. It definitly points to the database.

So i'm still lost - what do you recommend now?

Regads
Anton
 
Where is the value of #wdbase# set? If you're going to use a variable as a datasource name, the variable has to be set somewhere. Anyway, since you verified the your datasource, try taking out the # signs like this:

<cfquery name=&quot;category_list&quot; datasource=&quot;wdbase&quot; dbtype=&quot;ODBC&quot;>
SELECT DISTINCT Category
FROM TBLCategory
WHERE ((Category) Is Not Null)
ORDER BY Category;
</cfquery>
Calista :-X
Jedi Knight,
Champion of the Force
 
Calista is correct. The DSN or Data Source Name (not dns--that's Domain Name Service) is the actual name of your data source. Your DSN is &quot;wdbase&quot;. when you write #wdbase#, you are referencing a variable called &quot;wdbase&quot;. In your query where it says datasource=#wdbase#, you are saying &quot;get the value of the variable called wdbase and substitute it here&quot;. You are getting the error because you have not defined the variable wdbase. If you remove the pound signs, as calista says, it should work for you. But that is not the best solution. You generally don't want to hard-code the DSN into your program. What if you want to test your code using a different Access database? Or what if someone who installs your code already has a DSN called &quot;wdbase&quot; used in another application? The best practice is to put:

<cfset goat_app_DSN = &quot;wdbase&quot;>

in Application.cfm (in the root directory of your application), then refer to it like this:

<cfquery name=&quot;myquery&quot; datasource=#goat_app_DSN#&quot;>

This way, you can change the DSN for all of your queries by simply changing the definition of goat_app_DSN in application.cfm.
 
Thanks for the relies

But i'm sure it isnt an error in the code as it is working online at the old site:

So I'm going to hold of changing the code just at the moment.

I'm sure I must have missed a file when I downloaded the files from the server. There is a file called application.cfm but there was nothing in there about #wdbase#.

Can anyone suggest a possible file name where this varible might be set? I would have thought it would be in application.cfm but alas

thanks for the help
Anton
 
I have a file called GlobalVariables.cfm that is called by my Application.cfm. That is a possibility, because I got that idea from the examples that came with CF.

Why not just download the current site again? Check the number of files. If you've made changes, you could put it in a different folder and see if it works. What editor are you using? CF Studio has an Extended Find function that would allow you to search your code folder by folder for &quot;wdbase&quot;. That way you can see where it is set. Calista :-X
Jedi Knight,
Champion of the Force
 
Thanks for the reply Calista

I'm using Dreamweaver and Ultra Dev. As far as i'm aware there isnt any way to search for code through out the whole site - only page by page. Unless you know of a way.

And thanks heaps for the help - I really appreciate it :)

Anton
 
thanks for all your help

I've now downloaded the whole of the old site and it still doesnt go. dont know what else to do. I know there is nothing wrong with the code as it does work fine online.

and i have verified with cold fusion server that 'wdbase' is working.

thanks again.
 
Here is a free way to search the files in an entire directory tree for some ext that you specify (you can even use regular expressions): download a copy of TextPad from It is shareware, so you can &quot;evaluate&quot; it for free. The evaluation period is unlimited.

You say you don't know what else to do. How about trying Calista's am my suggestion and put this in application.cfm located in the root of your application:

<cfset wdbase = &quot;wdbase&quot;>

It clear what the problem is: the variable &quot;wdbase&quot; is not defined. So why not define it and see if that fixes it?
 
thanks - yeah i did try putting <cfset wdbase = &quot;wdbase&quot;> into the application.cfm file but still no change. I'll try getting
thanks again
Anton
 
Then try this: put the definition of wdbase on the line immediately preceeding the line that causes the error. What happens when you do that?
 
Hey Goat,

I was looking back over this thread and read where you said, &quot;But i'm sure it isn't an error in the code as it is working online at the old site&quot;. And you gave the URL. Well, I tried that URL and IT IS BROKEN! The old code is definitely NOT working. If you go to that URL and scroll down, you will see a ColdFusion error message. (Don't feel bad. After years of doing technical support, I have learned not to believe anything the user tells me until it I verify it. ;-) Since we seemed to be at a dead end, I decided to verify that you old code worked, and Voila!
 
Dont Feel Bad!

That link was working. I went into that site last night and copied the whole thing - and somehow buggered it.

I also lost my job today.

thanks for the reply
 
Actaully it has worked out well. It seems the database online is being stored on another server. But, I have found a local guy who I have worked with before and hes gonna gimme a hand.

I have certainly learnt a few things about cold fusion, but I have so much to learn too.

thanx for all ya help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top