arrgh 22 Posting Whiz

Not separately. I've only used a few cftextarea's which have the editor baked in. It'd probably be easier than trying to write the your own page builder. But your best bet is to try it out. See how well it fits in w/your app.

arrgh 22 Posting Whiz

I guess what I would need would be a way to tell the code that here is the beginning of a heading tag word(or new list basically)

Yup. I suppose you could assume the 1st line is always a header, and every other line is a "detail" line. But like the previous method, it's only as solid as the data ;-)

arrgh 22 Posting Whiz

There's one potential problem though. If the "detail" line doesn't have at least 1 "|", there'd be no way to distinguish it from the produce name headers

ie
Product Name
33244
Second Product Name
33990

arrgh 22 Posting Whiz

If every line has a hard carriage return at the end, that code won't work. The only way I can think of is to split the values on the carriage return, then check for a "|". If the line contains a "|" then it's NOT a header. Does that make sense?

<h3>Cross References</h3>
<cfoutput>
   <cfloop index="brandGroup" list="#FORM.crossRefList#" delimiters="#chr(13)##chr(10)#">
      <!--- header --->
      <cfif NOT find("|", brandGroup)>
           <h3>#brandGroup#</h3>
      <!--- detail line --->
      <cfelse>
           <ul>
           <cfloop index="productGroup" list="#brandGroup#" delimiters="|">
               <li>#productGroup#</li>
           </cfloop>
           </ul>
      </cfif>
   </cfloop>
</cfoutput>
arrgh 22 Posting Whiz

Got some good help at adobe forums...lol

... among others ;-)

Maybe it's lack of caffeine. But I've read the question twice and still don't understand what the data looks like. Could you give a sample of
A) the values you're using (FORM.crossRefList, SESSION.crossRefList, productGroup)
B) what the output SHOULD look like?

<cfloop index="productGroup" list="#listLast([/b]productGroup[/b],";")#" delimiters=";">

It's probably not a good idea to reuse the same name for your index variable.

arrgh 22 Posting Whiz

Because redirection occurs independent of the Yes/No values of that attribute

The AddToken attribute relates to client/session management. It has no affect on redirection. Only what's passed in the url. When addToken="yes", CF appends several client tokens (cfid, cftoken and possibly jsessionid) as URL parameters

So this

<cflocation url="http://www.yoursite.com/path/to/products.cfm?productid=4" addToken="yes">

becomes

http://www.yoursite.com/path/to/products.cfm?productid=4&cfid=xxxx&cftoken=xxxx&jsessionid=xxxxx"

If addToken="no", CF doesn't append the extra parameters to the URL

arrgh 22 Posting Whiz

Care to share the solution? I'm sure it will help others.

arrgh 22 Posting Whiz

Yup .. but good threads provide "closure" ;-) Besides, I'm curious if the app really didn't have a login page. lol.

arrgh 22 Posting Whiz

Wonder why people ask questions and never come back for the answer.

arrgh 22 Posting Whiz

Yeah, doesn't your app have a login page already? That's usually the point of having people register ...

arrgh 22 Posting Whiz

I wish this CF forum was more lively. I use adobes forums alot for CF. Havent found another forum for cf that I like yet.

Me too. But makes sense. Where's the 1st place most people are going to look? On the site of the people making the product ;-)

Cheers

arrgh 22 Posting Whiz

lol. That's one of my favorite expressions: "Make it idiot proof and they'll make a better idiot." ;-)

I hope that didn't come across the wrong way. I like that it applies to programmers in 2 ways:

programmer/idiot proofing <==> programmer/as the "idiot" user

:)

arrgh 22 Posting Whiz

What's wrong with this answer to your question?
http://forums.adobe.com/message/3295899#3295899

arrgh 22 Posting Whiz

lol. That's one of my favorite expressions: "Make it idiot proof and they'll make a better idiot." ;-)

arrgh 22 Posting Whiz

Don't you hate it when programs try to be "helpful" ;-)

arrgh 22 Posting Whiz

A windows shortcut? Just go to Desktop > right click > New > Shortcut and enter the url.

arrgh 22 Posting Whiz

What did the person that gave you the script say? They should know exactly what the problem is.. it's their code ;-)

arrgh 22 Posting Whiz

ORDER BY "ItemOrder" ASC

Don't use quotes. If you do, your db will treat ItemOrder as a string, not a column name. It's like saying

ORDER BY "IHaveNoIdeaWhyThisIsntWorkingThisIsNotARealColumn";

It may execute ... but it won't sort anything.

;-)

arrgh 22 Posting Whiz

It will help you solve your problem a LOT faster than us trying to explain how to use the various tools, so you can provide us with the debug info we need, ... one slow post at at time.

arrgh 22 Posting Whiz

Please don't take this the wrong way. But if you're not familiar with db's, how to generate a table DLL or CF .. I think you need more assistance than we can provide.
I'd suggest you should either ask to the person that gave you the code -OR- hire a CF person to fix it. Someone who knows the basics *and* has access to your code and db will be able to figure it out in no time.

arrgh 22 Posting Whiz

Doesn't seem like would cause the original error: operand clash.

1. Can you post the DDL for the "language" table? Get your db person to help if you need.

2. Dump the complete error message after the SQL statement

<cfcatch type="any">
   <cfoutput>#cfcatch.sql#</cfoutput>
   <cfdump var="#cfcatch#">    <!--- dumps complete error details --->
</cfcatch>
arrgh 22 Posting Whiz

No.. it's not fixed. You're misunderstanding what a cftry/cfcatch does. It only traps error messages. It does nothing to fix the problem. On your page, it will print out the SQL statement that failed.

ie <cfoutput>#cfcatch.sql#</cfoutput>

Post the result here. Then someone can help you figure out why the query isn't working.

arrgh 22 Posting Whiz

No, any SQL has to be inside the <cfquery> </cfquery> tags.

Easiest thing to do is go back to your original code. Then add the <cftry> to very 1st line and add the cfcatch after the very last line of the page. It's not how you'd normally do it. But it's impossible to mess up :)

<cfcatch type="any">
  <cfoutput>#cfcatch.sql#</cfoutput>
</cfcatch>
</cftry>
arrgh 22 Posting Whiz

Sounds like you put the code in the wrong place. The CFTRY needs to wrap your queries

<cftry>

     <!---Your code here--->
     <cfquery ...>.... sql .... </cfquery>
     <cfquery ...>.... sql .... </cfquery>
     ....

<cfcatch type="any">
	<cfoutput>#cfcatch.sql#</cfoutput>
</cfcatch>
</cftry>
arrgh 22 Posting Whiz

<cfif #Form.EnableMSSQL# eq "on">

Is this a flash form?

arrgh 22 Posting Whiz

<cfquery name="InsertUser" datasource="#request.dsn#">

BEGIN TRANSACTION
SET NOCOUNT ON

Nothing to do with your error, but the TRANSACTION is in the wrong place. In it's current spot, it doesn't do anything because there's only 1 statement in that cfquery. Transactions apply to multiple statements.

I'd bet dollars to donuts, whoever wrote that code meant to wrap it around both the UserDetails and UserContacts inserts..

arrgh 22 Posting Whiz

For future readers, "how" did you solve it? Was it a reserved word problem?

arrgh 22 Posting Whiz

Also, I was asking about what happens when you run the SQL directly in your db, *not* using cfquery. Using your IDE (Management Studio, etc..) you can easily view what tables and column exist.

arrgh 22 Posting Whiz

The error message is pretty clear. The db can't find the object (ie Table) "Language". Run the query against directly against your db in MS SQL. Does it work?

arrgh 22 Posting Whiz

Found the code on another site. It's this:

<cfmail to="#Form.Email#" [B]from=""[/B] subject="Blah Blah - New Account Confirmation" type="html">

The FROM address shouldn't be blank. Most mail servers would probably reject it anyway. Just put a valid email address in there.

arrgh 22 Posting Whiz
Attribute validation error for CFMAIL.
The value of the FROM attribute is invalid. The length of the string, 0 character(s), must be greater than or equal to 1 character(s).

It's an error from cfmail. It's just saying the sender address cannot be empty. Where in your code are you using CFMAIL?

arrgh 22 Posting Whiz

It'll work. But cfschedule takes some getting used to. I'd start out slow. Just create a small task that writes something to a log file first. Once you know it's working you can plug in your real page (after testing it separately of course).

arrgh 22 Posting Whiz

Sounds like a good job for a scheduled task. Just create a cfm page that queries your db for the desired records. Then send a cfmail to each one. Once the page is set up, create a scheduled task using the CF Administrator, or cfschedule. Schedule the task to run your cfm script daily (or however frequently you need).

arrgh 22 Posting Whiz

Well .. I don't mean literally by hand ;-) Just that you'd have 2 versions of the images: full sized and thumbnail.
You'd still use the same CF code. But you'd only do it once and save them. It can be a batch script that cfloops through all of your images. Or code triggered when some event occurs, like an image is uploaded.

It's just too process intensive to run a resize every time somebody requests or refreshes the page.

arrgh 22 Posting Whiz

CF9 has does have vfs. But image processing is time consuming. No avoiding it. It's usually better to just create thumbnails once and save them on disk. Resizing every time a user requests a page wastes a lot of resources.

arrgh 22 Posting Whiz

I still want to know what they mean by "there should not be any conflicts" ;-) Conflict how? The answer will determine how to best approach it.

Providing a username and password in your cfquery tag will over-ride the default username and password for the datasource.

That is a good thought. Though truthfully I've always been hesitant to pass around the username/password at the query level. Any idea if makes a difference? Is storing the login at the dsn level any more or less secure than at the cfquery level?

arrgh 22 Posting Whiz

Lol. Cfdump knows and reveals all. Better than a crystal ball. ;-)

arrgh 22 Posting Whiz

Grab it from the #CFFILE# scope. After you do a CFFILE upload, that scope will contain all kinds of information about the uploaded file like: cffile.serverFile, cffile.serverFileExt, etc..

See the reference docs for a full list
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-738f.html

... or just cfdump the whole scope after your upload. So you can see examples of all of the values :-)

<cffile action="upload" ...>
<cfdump var="#CFFILE#">

arrgh 22 Posting Whiz

Hi Can anyone help me how to point two cold fusion application to the same datasource.

Datasources are created at the CF server level. Just use the same datasource name in both applications.

Is it possible to have two differnet applications pointing to the same database?

Yes

If so how to distinguish them?

If you need to distinguish them, you probably shouldn't be using the same datasource for both.

Also if a same user access both the applications there should not be any conflicts.

No idea what you mean by that.

Please reply the solution to ...

No, it's more helpful to others if replies are posted on the forum.

arrgh 22 Posting Whiz

You mean store the file content in the db, not just the file path (ie "c:\path\myImage.gif")? While you can do it, it can drastically bloat your database. But if you really want to do it, here is an example. It's for Oracle but the overall process is the same for any db.

http://awads.net/wp/2006/01/25/savingdownloading-files-tofrom-oracle-using-coldfusion/

Just upload the file as usual ie using <cffile action="upload" ...>. But instead of storing the file path, you read the *contents* of the file into a variable. Then insert the variable's binary data into the database instead of the path. When you're done, you can delete the uploaded file.

<cffile action="readBinary" 
     file="#cffile.serverDirectory#/#cffile.serverFile#" 
     variable="fileContents">

<cfquery name="addFile" ....>
    INSERT INTO Table ( FileName ) 
    VALUES (
     <cfqueryparam value="#fileContents#" cfsqltype="cf_sql_blob">
    )
</cfquery>

<!--- once done, delete the physic. file --->
<cffile action="delete" 
     file="#cffile.serverDirectory#/#cffile.serverFile#" >

Retrieving the file from the db is the same as any SELECT. Just retrieve the record, and use CFCONTENT, with the proper mime type to display it in the browser. If you need any help with that part, just let me know.

One thing to watch out for is your CF datasource settings. If you have files that bigger than 64K, CF will only return the 1st 64K bytes unless you enabled the "BLOB" setting in your datasource.
http://awads.net/wp/2006/02/21/lobs-gotcha-in-coldfusion/

arrgh 22 Posting Whiz

I just wanted to learn different ways on how do things so im not tied down to one way. Ill try what you have posted, but if sql injection is a major factor then ill just forget about it and use what i have.

That's always a good attitude to have. But with this one I'd say the lesson learned is "don't do it" ;-)

Every time I use dynamic sql - I end up regretting it. Though it's possible to make it safe from sql injection ... it takes a lot of work. Much more than with non-dynamic sql. Plus debugging syntax errors can give you a major migraine!

arrgh 22 Posting Whiz

Very welcome

arrgh 22 Posting Whiz

CF has a built in tag for that. You can use cfzip with a "source" directory
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7695.html

arrgh 22 Posting Whiz

The problem is dynamic sql. Save yourself some headaches and don't use dynamic sql. It's never as easy as it looks ;-) Plus it's hard to debug and is a big sql injection risk if done wrong ...

But .. it doesn't look like you even need to return the query. You can just return the count. But dont' forget to VAR your cfquery's and use cfqueryparam

...
   <cfset var qry = "">
   <cfquery name="qry" ...>
      SELECT  count(status) AS Result 
      FROM    table 
      WHERE   status = <cfqueryparam value="#arguments.status#" cfsqltype="cf_sql_varchar">
   </cfquery>
   <cfreturn qry.Result>
...

I didnt know why it has 3 apostrophes

CF escapes single quotes to protect you from sql injection. The only way around it is to use PreserveSingleQuotes(). But then you're at risk for sql injection. Since you don't seem to need dynamic sql anyway, my advice is to avoid it altogether.

arrgh 22 Posting Whiz

Here you go.

Not sure how that applies, since they said they're not using cfauthenticate.

Don't know the answer. I've only seen one post that's even remotely similar.
http://www.justskins.com/forums/screwed-up-with-cfauthenticate-36844.html

arrgh 22 Posting Whiz

Well that's how we all learn, right :) Glad you figured it out.

arrgh 22 Posting Whiz

I don't know about onRequestEnd.CFM. But with Application.cfc the "targetPage" is passed into the onRequestEnd function. You could use string functions to determine if you should include the analytics. Maybe onRequestEnd.cfm has something similar?
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d42.html

arrgh 22 Posting Whiz

ie is funny sometimes.

Yeah, I don't think the original version worked in FF. As far as IE ... it's got it's own weird view of the html specs IMO ;-)

arrgh 22 Posting Whiz

Not sure why it even worked before with both lines of code

Were you testing with IE? Because it'll let you do all kinds of silly things ;-)

arrgh 22 Posting Whiz

No. You shouldn't have # marks for the anchor "name" OR the closing </a> tag. That's what the validator is complaining about ;-)

I updated the code on my previous post. You need to get rid of all the empty anchors in the header (that only have an "id"). Then your code should look like this:

Header:
<a href="#Z">Z</a>

The matching target in the content should be:
<a name="Z" /> Zone Lighting