CFQueryparam
This may be a simple question but, what is the BEST way to handle this dynamically at run time? I have a program that writes out a text file with a ton of queries on it. The queries are generated with text entered by the user from another page. When people enter # signs the query parameters in my generated text file look like. cfqueryparam cfsqltype=cf_sql_varchar value=Text #1 Obviously when I run the generated script the script bombs on the #. Any suggestions would be appreciated. CF 5.0 Windows 2000 Server David -Original Message- From: daniel kessler [mailto:[EMAIL PROTECTED] Sent: Monday, May 24, 2004 2:46 PM To: CF-Talk Subject: Re: oracle unique id or identity Daniel chopped it off in his version yeah since I was getting errors, I was trying to simplify to determine the problem. flpweb is not the CF datasource, per se, though in your set up, it might be. It's actually the oracle user account. ah that makes a world of difference.It's scoped.We don't seem to have users of a table; I don't generally include un/pwd. The other two you are correct on. However, if you're getting the insufficient privs error, I would say that you got the general info correct. Let's take CF out of the picture for a moment. In your Oracle account (via sqlplus or Toad or whatever tool you use), log in as the user that owns the table you're going to update. Run the trigger script. I don't have access to the GUI tools here at the college.Our IT has told my partner here that they're insecure so off-limits.Really doesn't help, since I'm a DB novice. Nonetheless, I got the command to make the trigger work using your original code, which was easy once I realized there was no 'user'.It told me that it executed.I did: - CREATE OR REPLACE TRIGGER trg_hhp_calendar_id BEFORE INSERT ON hhp_calendar REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW DECLARE iCounter hhp_calendar.id%TYPE; cannot_change_counter EXCEPTION; BEGIN IF INSERTING THEN Select uniqueNum_s.NEXTVAL INTO iCounter FROM Dual; :new.id := iCounter; END IF; IF UPDATING THEN IF NOT (:new.id = :old.id) THEN RAISE cannot_change_counter; END IF; END IF; EXCEPTION WHEN cannot_change_counter THEN raise_application_error(-2, 'Cannot Change Counter Value'); END; / - btw, it didn't like the BEFORE INSERTOR UPDATE.I had to delete the OR UPDATE, so I guess I shouldn't have included the IF UPDATE part.oh well, no real harm. Now the bad part.When I try to insert a new record, I receive an error, [Macromedia][Oracle JDBC Driver][Oracle]ORA-04098: trigger 'DPCH.TRG_HHP_CALENDAR_ID' is invalid and failed re-validation. Also, in the INSERT, I fill in an entry for ID, which is also being filled by the trigger.I just figured that the trigger would toss it.True?The insert looks like: INSERT INTO HHP_CALENDAR (id,header,http,description,dateAdded,event_date,image) VALUES (6,'#Form.header#','#Form.http#','#Form.description#',#the_date#,#the_event_ date#,'#Form.image#') [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: CFQueryparam
Please ignore the bottom part of this message, I hit reply and forgot to remove the other persons message. Thanks, David -Original Message- From: David Jones [mailto:[EMAIL PROTECTED] Sent: Monday, May 24, 2004 3:32 PM To: CF-Talk Subject: CFQueryparam This may be a simple question but, what is the BEST way to handle this dynamically at run time? I have a program that writes out a text file with a ton of queries on it. The queries are generated with text entered by the user from another page. When people enter # signs the query parameters in my generated text file look like. cfqueryparam cfsqltype=cf_sql_varchar value=Text #1 Obviously when I run the generated script the script bombs on the #. Any suggestions would be appreciated. CF 5.0 Windows 2000 Server David -Original Message- From: daniel kessler [mailto:[EMAIL PROTECTED] Sent: Monday, May 24, 2004 2:46 PM To: CF-Talk Subject: Re: oracle unique id or identity Daniel chopped it off in his version yeah since I was getting errors, I was trying to simplify to determine the problem. flpweb is not the CF datasource, per se, though in your set up, it might be. It's actually the oracle user account. ah that makes a world of difference.It's scoped.We don't seem to have users of a table; I don't generally include un/pwd. The other two you are correct on. However, if you're getting the insufficient privs error, I would say that you got the general info correct. Let's take CF out of the picture for a moment. In your Oracle account (via sqlplus or Toad or whatever tool you use), log in as the user that owns the table you're going to update. Run the trigger script. I don't have access to the GUI tools here at the college.Our IT has told my partner here that they're insecure so off-limits.Really doesn't help, since I'm a DB novice. Nonetheless, I got the command to make the trigger work using your original code, which was easy once I realized there was no 'user'.It told me that it executed.I did: - CREATE OR REPLACE TRIGGER trg_hhp_calendar_id BEFORE INSERT ON hhp_calendar REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW DECLARE iCounter hhp_calendar.id%TYPE; cannot_change_counter EXCEPTION; BEGIN IF INSERTING THEN Select uniqueNum_s.NEXTVAL INTO iCounter FROM Dual; :new.id := iCounter; END IF; IF UPDATING THEN IF NOT (:new.id = :old.id) THEN RAISE cannot_change_counter; END IF; END IF; EXCEPTION WHEN cannot_change_counter THEN raise_application_error(-2, 'Cannot Change Counter Value'); END; / - btw, it didn't like the BEFORE INSERTOR UPDATE.I had to delete the OR UPDATE, so I guess I shouldn't have included the IF UPDATE part.oh well, no real harm. Now the bad part.When I try to insert a new record, I receive an error, [Macromedia][Oracle JDBC Driver][Oracle]ORA-04098: trigger 'DPCH.TRG_HHP_CALENDAR_ID' is invalid and failed re-validation. Also, in the INSERT, I fill in an entry for ID, which is also being filled by the trigger.I just figured that the trigger would toss it.True? The insert looks like: INSERT INTO HHP_CALENDAR (id,header,http,description,dateAdded,event_date,image) VALUES (6,'#Form.header#','#Form.http#','#Form.description#',#the_date#,#the_event_ date#,'#Form.image#') [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: CFQueryparam
that's the thing how do I do that? if my variable value from a database is... query.fieldname = some text with a # would this work? replace(query.fieldname, #, ##) I don't think this will work.I am wondering if I even tried it, I think I did but perhaps I should try again to be sure. Thanks, David -Original Message- From: Matt Robertson [mailto:[EMAIL PROTECTED] Sent: Monday, May 24, 2004 3:43 PM To: CF-Talk Subject: Re: CFQueryparam When you generate your text, can you escape (i.e. double up) the pound signs?Not something I've tried before.Just a thought off the cuff. -- --- Matt Robertson,[EMAIL PROTECTED] MSB Designs, Inc. http://mysecretbase.com --- -- [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: CFQueryparam
Incase anyone wants to know, this worked for me. cfoutput cfset var = some text ##1 !--- value in variable looks like some text #1 --- cfset var = #replace(var, chr(35), chr(35) chr(35))# !--- This will double up the # to ## again so that that printed script will be correct. #var# /cfoutput I had forgotten about the CHR() function. THanks, David -Original Message- From: David Jones [mailto:[EMAIL PROTECTED] Sent: Monday, May 24, 2004 4:05 PM To: CF-Talk Subject: RE: CFQueryparam that's the thing how do I do that? if my variable value from a database is... query.fieldname = some text with a # would this work? replace(query.fieldname, #, ##) I don't think this will work.I am wondering if I even tried it, I think I did but perhaps I should try again to be sure. Thanks, David -Original Message- From: Matt Robertson [mailto:[EMAIL PROTECTED] Sent: Monday, May 24, 2004 3:43 PM To: CF-Talk Subject: Re: CFQueryparam When you generate your text, can you escape (i.e. double up) the pound signs?Not something I've tried before.Just a thought off the cuff. -- --- Matt Robertson,[EMAIL PROTECTED] MSB Designs, Inc. http://mysecretbase.com --- -- [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: CFQueryparam
instead of replace(query.fieldname,#,##,ALL) I had to replace the # with char(35)the single pound will throw an error even in the replace function. So I ended up with replace(query.fieldname,char(35), char(35) char(35), ALL) Thanks, David -Original Message- From: Matt Robertson [mailto:[EMAIL PROTECTED] Sent: Monday, May 24, 2004 4:22 PM To: CF-Talk Subject: RE: CFQueryparam thats what I was thinking of.Before writing the string: cfset mycfqueryparamval=replace(query.fieldname,#,##,ALL) then use mycfqueryparamval instead of query.fieldname when you lay down your cfqueryparam statement. -- --- Matt Robertson,[EMAIL PROTECTED] MSB Designs, Inc. http://mysecretbase.com --- -- [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: SQL custom Order by
This could be a freak accident that this works for me.. But it did in SQL 2000.This may not be the most efficient way of doing this either. SELECT* FROMcategory WHERE CatID = 10 union all SELECT* FROMcategory WHERE CatID = 3 union all SELECT* FROMcategory WHERE CatID = 5 union all SELECT* FROMcategory WHERE CatID = 1 Try it, David -Original Message- From: Plunkett, Matt [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 09, 2004 1:39 PM To: CF-Talk Subject: RE: SQL custom Order by -Original Message- From: Mark W. Breneman Sent: Tuesday, March 09, 2004 1:24 PM To: CF-Talk Subject: SQL custom Order by I doubt this is possible, but is there a way to do a custom order by based on the order I provide?I need the SQL results to be in a specific order based on the catID, but not in ascending or descending order. The order that I want them in is 10,3,5,1,7,4,9,2,6,8. (Not sure this is possible in Sql Server, cause I don't use that). I would write a custom function to do this.So you would do: select catID, mysort(catID) srt from foo order by srt; In the function, just return what order you want given the catId. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Oracle Stored Procedure and CF 5.0
Matt, Do you know off hand how to return multiple record sets this way? I want to return the results from the first query to CF.Then I want to run some other queries using data from the query above and return them too, is this possible? For instance select EmpID, EmpName from Employee--- I want this in the first CFPROCRESULT Then I want to loop these results inside the SP and create other recordsets select EmpPosition from EmployeePosition where EmpID = Employee.EmpID (This is where I am not sure, I don't how to do this) --- I also want these queries returned to CF I would end up with cfprocresult name=Employees I would loop these based on how many there are and replace the 1,2,3,ect... cfprocresult name=EmployeePosition1 resultSet=2 cfprocresult name=EmployeePosition2 resultSet=3 cfprocresult name=EmployeePosition3 resultSet=4 cfprocresult name=EmployeePosition4 resultSet=5 cfprocresult name=EmployeePosition5 resultSet=6 cfprocresult name=EmployeePosition6 resultSet=7 Can I even do this? Thanks, David -Original Message- From: Plunkett, Matt [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 11:21 AM To: CF-Talk Subject: RE: Oracle Stored Procedure and CF 5.0 -Original Message- From: Rob Rohan Sent: Friday, January 30, 2004 12:00 PM To: CF-Talk Subject: Re: Oracle Stored Procedure and CF 5.0 cfstoredproc procedure=sp_login datasource=#request.dsn# debug=no cfprocparam dbVarName=ipaddress value=#cgi.REMOTE_ADDR# CFSQLtype=CF_SQL_VARCHAR null=No cfprocparam dbVarName=login value=#cli_username# CFSQLType=CF_SQL_VARCHAR null=No cfprocparam dbVarName=password value=#rmsEncrypt(cli_password)# CFSQLType=CF_SQL_VARCHAR null=No cfprocresult name=checkClientCreds resultSet=1 !--- if you had other result sets you could do this as well cfprocresult name=otherstuff resultSet=2 ... --- /cfstoredproc This procedure is not completely correct for CF 5 (I think it is correct for MX, but I mainly use 5, so who knows...). In CF5, you must put the parameter in for the ref cursor and set maxrows=-1: cfstoredproc procedure=sp_login datasource=#request.dsn# debug=no cfprocparam dbVarName=ipaddress value=#cgi.REMOTE_ADDR#CFSQLtype= CF_SQL_VARCHAR null=No cfprocparam dbVarName=login value=#cli_username# CFSQLType= CF_SQL_VARCHAR null=No cfprocparam dbVarName=password value=#rmsEncrypt(cli_password)# CFSQLType=CF_SQL_VARCHAR null=No cfprocparam type=Out cfsqltype=CF_SQL_REFCURSOR maxrows=-1 variable=p_ref cfprocresult name=checkClientCreds /cfstoredproc I left the rest of Rob's query the same, although I don't use dbVarName and I always set the type (In, Out, In/Out).Another gotcha: you need to keep the parameters in the same order that they appear in your procedure, even though you get to set the name. HTH, Matt [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Oracle Stored Procedure and CF 5.0
This was exactly what I was looking for.But when I did it I created a package and pass the cursor from the procedure to the package. I did this because this is how it was explained on the macromedia website (I should have looked on the site before asking the question).Do I not have to do this? Was this just for organization? Thanks, David -Original Message- From: Rob Rohan [mailto:[EMAIL PROTECTED] Sent: Friday, January 30, 2004 12:00 PM To: CF-Talk Subject: Re: Oracle Stored Procedure and CF 5.0 On Fri, 2004-01-30 at 07:50, David Jones wrote: I have a client that wants me to remove all inline SQL from his application even though I am using the CFQueryParam tag to invoke the use of bind variables.I am fairly familiar with Oracle Stored Procedures but what I not familiar with is returning queries from a Stored Procedure to CF 5.0. Is this possible, if so can someone provide me with a simple example. if you havent found this out already, here is an example of using a stored procedure cfstoredproc procedure=sp_login datasource=#request.dsn# debug=no cfprocparam dbVarName=ipaddress value=#cgi.REMOTE_ADDR# CFSQLtype=CF_SQL_VARCHAR null=No cfprocparam dbVarName=login value=#cli_username# CFSQLType=CF_SQL_VARCHAR null=No cfprocparam dbVarName=password value=#rmsEncrypt(cli_password)# CFSQLType=CF_SQL_VARCHAR null=No cfprocresult name=checkClientCreds resultSet=1 !--- if you had other result sets you could do this as well cfprocresult name=otherstuff resultSet=2 ... --- /cfstoredproc One of the reasons I like stored procedures so much is you can get multi query sets back for the price of one database hit. anyway, hope that helps. -- Vale, Rob Luxuria immodica insaniam creat. Sanam formam viatae conservate! http://www.rohanclan.com http://treebeard.sourceforge.net http://ashpool.sourceforge.net [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Oracle Stored Procedure and CF 5.0
Yeah, I actually found all this information on the macromedia website right after I posted this.This is really cool, and works very nicely. I played with it this weekend, I really like that you can return multiple record sets with one procedure. Thanks, David -Original Message- From: Plunkett, Matt [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 11:21 AM To: CF-Talk Subject: RE: Oracle Stored Procedure and CF 5.0 -Original Message- From: Rob Rohan Sent: Friday, January 30, 2004 12:00 PM To: CF-Talk Subject: Re: Oracle Stored Procedure and CF 5.0 cfstoredproc procedure=sp_login datasource=#request.dsn# debug=no cfprocparam dbVarName=ipaddress value=#cgi.REMOTE_ADDR# CFSQLtype=CF_SQL_VARCHAR null=No cfprocparam dbVarName=login value=#cli_username# CFSQLType=CF_SQL_VARCHAR null=No cfprocparam dbVarName=password value=#rmsEncrypt(cli_password)# CFSQLType=CF_SQL_VARCHAR null=No cfprocresult name=checkClientCreds resultSet=1 !--- if you had other result sets you could do this as well cfprocresult name=otherstuff resultSet=2 ... --- /cfstoredproc This procedure is not completely correct for CF 5 (I think it is correct for MX, but I mainly use 5, so who knows...). In CF5, you must put the parameter in for the ref cursor and set maxrows=-1: cfstoredproc procedure=sp_login datasource=#request.dsn# debug=no cfprocparam dbVarName=ipaddress value=#cgi.REMOTE_ADDR#CFSQLtype= CF_SQL_VARCHAR null=No cfprocparam dbVarName=login value=#cli_username# CFSQLType= CF_SQL_VARCHAR null=No cfprocparam dbVarName=password value=#rmsEncrypt(cli_password)# CFSQLType=CF_SQL_VARCHAR null=No cfprocparam type=Out cfsqltype=CF_SQL_REFCURSOR maxrows=-1 variable=p_ref cfprocresult name=checkClientCreds /cfstoredproc I left the rest of Rob's query the same, although I don't use dbVarName and I always set the type (In, Out, In/Out).Another gotcha: you need to keep the parameters in the same order that they appear in your procedure, even though you get to set the name. HTH, Matt [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Oracle Stored Procedure and CF 5.0
I have a client that wants me to remove all inline SQL from his application even though I am using the CFQueryParam tag to invoke the use of bind variables.I am fairly familiar with Oracle Stored Procedures but what I not familiar with is returning queries from a Stored Procedure to CF 5.0. Is this possible, if so can someone provide me with a simple example. Thanks, David [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Array Problem
Can someone help me with this error? An error occurred while evaluating the expression: codeArray[getRespondents.currentRow] = lvAllAnswerCodeStr Error near line 335, column 16. Cannot set element of indexed object The element at position 1 of the object cannot be set. May be the object is read-only. The object has elements in positions 1 through 0. The error is in dimension 1 of object codeArray. This is consistant on one server but never happens on others. It is giving me a headache. It is caused by - cfset codeArray = ArrayNew(len(getRespondents.RecordCount)) cfloop query=getRespondents cfset codeArray[getRespondents.CurrentRow] = 82NN41243NNN409NN409NNN 2003-03-20 13:57:53NN14 5NN172NN217NN1010NN1 85N4N234NNN41NN41NN41NN4NNN4NNN4NNN41NNN NNN41NN4N1022NN2 NNN20NNN NN /cfloop Any help will be appreciated. Thanks, Dvaid ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Host with the leader in ColdFusion hosting. Voted #1 ColdFusion host by CF Developers. Offering shared and dedicated hosting options. www.cfxhosting.com/default.cfm?redirect=10481 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Array Problem
I just found my problem. I was just using the ArrayNew function incorrectly ArrayNew(len(getRespondents.RecordCount)) Thanks, David -Original Message- From: David Jones [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2003 7:16 PM To: CF-Talk Subject: Array Problem Can someone help me with this error? An error occurred while evaluating the expression: codeArray[getRespondents.currentRow] = lvAllAnswerCodeStr Error near line 335, column 16. Cannot set element of indexed object The element at position 1 of the object cannot be set. May be the object is read-only. The object has elements in positions 1 through 0. The error is in dimension 1 of object codeArray. This is consistant on one server but never happens on others. It is giving me a headache. It is caused by - cfset codeArray = ArrayNew(len(getRespondents.RecordCount)) cfloop query=getRespondents cfset codeArray[getRespondents.CurrentRow] = 82NN41243NNN409NN409NNN 2003-03-20 13:57:53NN14 5NN172NN217NN1010NN1 85N4N234NNN41NN41NN41NN4NNN4NNN4NNN41NNN NNN41NN4N1022NN2 NNN20NNN NN /cfloop Any help will be appreciated. Thanks, Dvaid ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Randomization of a cfquery
This function seems to be working beautifully. Thank you. Dave -Original Message- From: Christian Cantrell [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 21, 2002 9:39 PM To: CF-Talk Subject: Re: Randomization of a cfquery It's not as easy as it seems. Here's a function that I believe will do the trick. I wrote it pretty quickly, so if you are going to use it, test it thoroughly. Just pass in a query object and it will return a new query object with the rows randomized. You can wrap it in a custom tag if you like, but it makes a good function in my opinion. cfscript function queryRandomize(toRandomize) { var size = toRandomize.recordcount; var cols = toRandomize.columnList; var colArray = listToArray(cols); var newQuery = queryNew(cols); var i = 0; var j = 0; var randomRow = 0; // // Create an array of integers that is the size of the record set. // We will draw on this array randomly and resize it dynamically. // var numberBank = arrayNew(1); for (i = 1; i neq size + 1; i = i + 1) { numberBank[i] = i; } queryAddRow(newQuery, size); for (i = 1; i neq (size + 1); i = i + 1) { randomRow = randRange(1, arrayLen(numberBank)); for (j = 1; j neq (arrayLen(colArray) + 1); j = j + 1) { querySetCell(newQuery, colArray[j], toRandomize[colArray[j]][i], numberBank[randomRow]); } arrayDeleteAt(numberBank, randomRow); } return newQuery; } /cfscript On Saturday, December 21, 2002, at 04:25 PM, David Jones wrote: Does anyone have a custom tag that will take a regular query and randomize the results? I don't have to have a custom tag a database solution would do as well. Anything would help at this point. This seems like a simply thing to do. I am using Oracle for my backend so if anyone knows of a way to do it there that would be great too. Thanks in advance, Dave ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
Randomization of a cfquery
Does anyone have a custom tag that will take a regular query and randomize the results? I don't have to have a custom tag a database solution would do as well. Anything would help at this point. This seems like a simply thing to do. I am using Oracle for my backend so if anyone knows of a way to do it there that would be great too. Thanks in advance, Dave ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: Randomizing Query Results
What database does this work on? I should have specified what database I am using. I am developing for Oracle 8i. Thanks, Dave -Original Message- From: Jochem van Dieten [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 10:42 AM To: CF-Talk Subject: Re: Randomizing Query Results David Jones wrote: What is the best way to randomize the results of a CF query? Offload it to the database: SELECT * FROMtable ORDER BYRandom() Jochem ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
RE: Randomizing Query Results
I want to randomize what ever results return from the query. Could be 1,2,,,500 and so on. Thanks, Dave -Original Message- From: Mike Townend [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 9:34 AM To: CF-Talk Subject: RE: Randomizing Query Results In what way? Do you just want to display a random record from a set... Or a load of records just in a random order? -Original Message- From: David Jones [mailto:[EMAIL PROTECTED]] Sent: Monday, October 7, 2002 14:24 To: CF-Talk Subject: Randomizing Query Results What is the best way to randomize the results of a CF query? Thanks, Dave ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
Randomizing Query Results
What is the best way to randomize the results of a CF query? Thanks, Dave ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com
Converting HTML to a text file using the Excel object
Can anyone point me in the correct direction for converting HTML to a text file using the Excel object? I imagine it can be done. I can open the HTML page in Excel and save it as tab delimited text and it does exactly what I need it to. I just need to know how to do it directly from the excel object. Thanks, Dave __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Dynamic Checkboxes
I am having some trouble with dynamically named checkboxes. This is what I am trying to do On a form I have some dynamically named form variables. like Cfloop from = 1 to = #vLoopNUm# index=x input type=text name=pvAnswer_ID#x# value= input type=text name=txtAnswer_Display_sequence#x# value= input type=text name=txtObject_Type_ID#x# value= input type=text name=txtAnswer_Text#x# value= input type=text name=txtAnswer_Field_Name#x# value= input type=text name=txtAnswer_Code#x# value= input type=checkbox name=chkRemove#x# value= /Cfloop I submit to Cfloop from = 1 to = #vLoopNUm# index=x cfset vAnswer_ID = pvAnswer_ID#x# cfset vAnswer_Display_sequence = txtAnswer_Display_sequence#x# cfset vObject_Type_ID = txtObject_Type_ID#x# cfset vAnswer_Text = txtAnswer_Text#x# cfset vAnswer_Field_Name = txtAnswer_Field_Name#x# cfset vAnswer_Code = txtAnswer_Code#x# cfset vRemove = chkRemove#x# #evaluate(vAnswer_ID)# #evaluate(vAnswer_Display_sequence)# #evaluate(vObject_Type_ID)# #evaluate(vAnswer_Text)# #evaluate(vAnswer_Field_Name)# #evaluate(vAnswer_Code)# #evaluate(vRemove)# CFloop All of these work except for the checkbox. The reason is because checkboxes aren't submitted of they aren't checked. So I would think that I should use some thing like this to verify that the variable exists before setting the variable to it's value. cfif #parameterExists(evaluate(vRemove))# cfset vremove = 1 cfelse cfset vremove=0 cfif but this doesn't work either. Any Suggestions. Thanks, Dave __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Free to cheap Forum Software
Go to http://forum.snitz.com/ they have a nice one that is totally free. They also have a page that lists all there competitors. Thanks, Dave -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 9:05 AM To: CF-Talk Subject: Free to cheap Forum Software hello all. i know this has been discussed in the past if you have links to free or cheap forum or discussion boards i would appreciate it. thanks -paul __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CF 5 and CFMX
Has anyone had a chance to try any of this yet? Do you think this will increase speed on CF 5 also? I'll more than likely try this tonight or tomorrow I was just curious if it was worth the effort for CF 5. Thanks, Dave -Original Message- From: Debbie Dickerson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 10:39 AM To: CF-Talk Subject: RE: CF 5 and CFMX TechNote 22921 (ColdFusion MX: Using Application Scope to improve COM Performance) was pushed live this morning, so it might help. http://www.macromedia.com/v1/Handlers/index.cfm?ID=22921Method=Full There are a couple more COM TechNotes in the works, but they're still going through the edit/review process. Deb -Original Message- From: Earl, George [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 10:00 AM To: CF-Talk Subject: Re: CF 5 and CFMX Dave said: snipped ... I was wondering mainly about COM. I have a very large app that I am developing using VB6 COM and CF 5. I have noticed that this is very slow with CF 5. The average page with a COM object on it loads in about 800-900 milliseconds. Which is very slow when compared to straight CF. snipped ... I wanted to know if CFMX was better or worse with COM. snipped ... end of Dave From page 25 of Migrating ColdFusion 5 Applications: COM objects ColdFusion MX uses the Java Native Interface (JNI) to call COM objects, which results in slower performance than in ColdFusion 5. How much slower depends on the application and COM, but in the Macromedia tests of the same code, ColdFusion 5 completed in 50 milliseconds and ColdFusion MX completed in 2-3 seconds. HTH, George [EMAIL PROTECTED] __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
CF 5 and CFMX
Has anyone experienced any issues with existing CF 5.0 code not functioning properly after upgrading to CFMX? Thanks, Dave __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CF 5 and CFMX
I think if I had read previous emails I would have had my answer before I asked. I was wondering mainly about COM. I have a very large app that I am developing using VB6 COM and CF 5. I have noticed that this is very slow with CF 5. The average page with a COM object on it loads in about 800-900 milliseconds. Which is very slow when compared to straight CF. I am scared that when the app is done and it gets hit by a thousand simultaneous users it will slow to a crawl. 900 milliseconds isn't too bad if it wont dramatically increase with traffic. Bandwidth wont be an issue. I wanted to know if CFMX was better or worse with COM. What I have been reading is that CFMX is very mean to COM. I may be converting my COM to CF. let me know what you all think. Thanks, Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 10, 2002 9:56 AM To: CF-Talk Subject: Re: CF 5 and CFMX Not really, can you provide an example? ~Todd On Mon, 10 Jun 2002, David Jones wrote: Has anyone experienced any issues with existing CF 5.0 code not functioning properly after upgrading to CFMX? Thanks, Dave -- Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/ | http://www.flashCFM.com/ - webRat (Moderator)| http://www.ultrashock.com/ - webRat (Back-end Moderator) | __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CF 5 and CFMX
I have installed some application stress testing utilities. Depending on how the app does with a high amount of simulated traffic I may rewrite the COM's in CF. I just hate to have to do that. Thanks, Dave -Original Message- From: Lewis Sellers [mailto:[EMAIL PROTECTED]] Sent: Monday, June 10, 2002 2:57 PM To: CF-Talk Subject: Re: CF 5 and CFMX On Mon, 10 Jun 2002 10:03:44 -0500, in cf-talk you wrote: Dave, CFMX uses a Java COM wrapper that was developed by a 3rd party and rolled into CFMX. The name of the company that built it escapes me at the moment. However, this added layer is probably not good news for COM centric CFML code. A Macromedia rep told me they are hoping to release fixes for the problems with COM in the first MX service release. I get the feeling a programmer somewhere isn't getting much sleep of late. For your information the jintegra com--java interface a) is a slug and b) doesn't work very well, especially with COM properties. In fact isn't a single COM I have that works at all under CFMX if it involves setting a property. I rolled back to CF5 for the time being. --min __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
SMTP Relay
Does anyone know of a free SMTP relay server? I have a client that wants to access is email while connected to AOL. But AOL doesn't have a SMTP server he can use. The people that handle him email are having problems with their SMTP server. So I figured I would try to find him a temporary relay server he can use. Thanks, Dave __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: SMTP Relay
I'm looking more for one that someone else is already hosting. Dave -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 1:49 PM To: CF-Talk Subject: Re: SMTP Relay Argo Soft Mail Server...free and easy to use (FTP server is great too) Bryan Stevenson VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: David Jones [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Thursday, June 06, 2002 10:41 AM Subject: SMTP Relay Does anyone know of a free SMTP relay server? I have a client that wants to access is email while connected to AOL. But AOL doesn't have a SMTP server he can use. The people that handle him email are having problems with their SMTP server. So I figured I would try to find him a temporary relay server he can use. Thanks, Dave __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Secure Content
What would be the best way to help prevent a user from copying text from a website. I have a client that wants me to write an application that will allow him to create a help book similar to if you were to use windows help. But he wants to make sure that his employees can't copy it and take it to a competitor. I was thinking that I could dynamically create images to display the content of each page instead of showing the text on the page. Granted the user could just take a screen shot or possibly download it but it might deter then a small bit. I was also thinking of using Adobe's SVG. Any advice would be appreciated. Thanks, Dave __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Secure Content
Well like you say... I know that I cant keep some away if they are determined but I can always make it a bit more difficult. Thanks, Dave -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 8:49 PM To: CF-Talk Subject: RE: Secure Content How about Flash? Nope. Just like Jochem's humorous link says: The page you are looking at belongs to me. Here it is, displayed on your computer. Let's see. The page and content were on my server and downloaded to your computer and then your browser displayed the page. So, my page and content is actually now saved somewhere on your computer. There is nothing I can do that will stop you from getting a copy of my code and my pictures on your computer. There they sit, just waiting in your 'temporary Internet files' folder. And it get's worse than that! While it might be difficult to retrieve those files from the temporary Internet files folder, you could always make a copy of the screen image, complete with my pictures!! Isn't there anything that can be done? Basically, no. The best that you can do is make it difficult for people to copy your pictures or copy your code Just like HTML, Flash content is downloaded to the client. Anything that is displayed on my screen is mine for the taking. You can make it more difficult for the casual copyer, but if your content really has that sort of value, you don't want to display it on an untrusted user's screen. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Unstructured info
This may sound like a silly question but I am having a hard time figuring this out. What is the CF equivalent to the VBScript UBound(arrayName,2)? I have been all through the docs and cant find it. Thanks, Dave __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Array Question
This may sound like a silly question but I am having a hard time figuring this out. What is the CF equivalent to the VBScript UBound(arrayName,2)? I have been all through the docs and cant find it. Thanks, Dave __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Array Question
Thanks, I'll check out that site. Another Question I am using com objects to return arrays to the CF page. I do most of my coding ASP and the objects work wonderfully. I seem to be running into a lot of silly problems when trying to code this way for CF. My objective is to have separation between my database layer and my presentation layer. So that if I need to convert the code later to some other language it wont be a problem. Some projects I do require CF, some ASP, and some times others. So I want to have good componentized code that I can reuse. How do you guys handle things like this in CF? Do any of you program with COM regularly? I am getting the feeling that it might not be the best idea with CF. Any guidance would be appreciated. Thanks, Dave -Original Message- From: Jeff Garza [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 1:32 AM To: CF-Talk Subject: RE: Unstructured info The function UBound(arrayname, 2) returns the greatest value from the second dimension of the array ArrayName. The closest function in CF to this is ArrayMax(arrayName) but that only returns the greatest value from a one dimensional array. You'll have to copy the values from second dimension of your array to a separate array and then get the ArrayMax of the new array. You might also want to check CFLib.org and see if there is a user defined function that will deal with multi-dimensional arrays. Jeff -Original Message- From: David Jones [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 10:19 PM To: CF-Talk Subject: RE: Unstructured info This may sound like a silly question but I am having a hard time figuring this out. What is the CF equivalent to the VBScript UBound(arrayName,2)? I have been all through the docs and cant find it. Thanks, Dave __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: UBound (was RE: Unstructured info)
Ok thanks, I'll look into this. Dave -Original Message- From: Matt Liotta [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 1:55 AM To: CF-Talk Subject: RE: UBound (was RE: Unstructured info) In CF multi-dimensional arrays are just nested single-dimensional arrays. Thus you could use the following syntax to get the max value of the second dimension. ArrayMax(arrayName[1]) However, that assumes that there is only a single item in the first dimension. This leads me to the following untested UDF. function UBound(array, dimension) { if(dimension eq 1) return ArrayMax(array); else if(dimension eq 2) { var tmpArray = ArrayNew(1); for(itr = 1; itr lte ArrayLen(array); itr = itr + 1) tmpArray[ArrayLen(tmpArray + 1)] = ArrayMax(array[itr]); return ArrayMax(tmpArray); } else { //someone else can implement this case } } -Matt -Original Message- From: Jeff Garza [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 10:32 PM To: CF-Talk Subject: RE: Unstructured info The function UBound(arrayname, 2) returns the greatest value from the second dimension of the array ArrayName. The closest function in CF to this is ArrayMax(arrayName) but that only returns the greatest value from a one dimensional array. You'll have to copy the values from second dimension of your array to a separate array and then get the ArrayMax of the new array. You might also want to check CFLib.org and see if there is a user defined function that will deal with multi-dimensional arrays. Jeff -Original Message- From: David Jones [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 10:19 PM To: CF-Talk Subject: RE: Unstructured info This may sound like a silly question but I am having a hard time figuring this out. What is the CF equivalent to the VBScript UBound(arrayName,2)? I have been all through the docs and cant find it. Thanks, Dave __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: SQL Question
This might not help you but just off the top of my head If I were to write a script to do this I might approach it like this or a rendition of this. I don't think you can do this sort of thing with DTS but I could be wrong. I just wrote it out so it would be easier to look at. I hope this makes sense. select distinct(foreign_id) from table cfoutput though query insert into new_table (id,Foreign_ID) values('IncrementingNumber', 'Whatever current foreign_ID'); update new_table set select value from table where foreign_ID='Whatever current foreign_ID' cfoutput though new_query value#NewIncrementingNumber#='#query.value#' /cfoutput though query where foreign_ID='Whatever current foreign_ID' /cfoutput though query or you could write a text file for DTS to pick up. The code below would need to be on one line. You could write the same sort of thing in TQL to be executed in a stored procedure. select distinct(foreign_id) from table Write file cfoutput though query IncrementingNumber, Whatever current foreign_ID select value from table where foreign_ID='Whatever current foreign_ID' cfoutput though new_query , #query.value# /cfoutput though query /cfoutput though query /Write file Somebody chime in if they can see a better way. Thanks, Dave -Original Message- From: Timothy Heald [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 9:49 AM To: CF-Talk Subject: SQL Question Hey folks, I have a table like this: id foreign id value 1 1 1 2 1 2 3 1 3 4 2 1 5 2 2 6 2 3 Regular old normalized table right? Well I need to get it into columns like this: foreignID value1 value2 value3 1 1 2 3 2 1 2 3 Now I know it is possible, but difficult. I would do it with CF but no matter how high I set the time out in my administrator, and my web server it times out, or says page cannot be displayed. It is pulling huge amounts of data, then outputting it it an Excel spread sheet. We tried to do it with a DTS package and the use SQL Mail to send it, but couldn't get that to work reliably. TIA. Tim Heald ACP/CCFD :) Application Development www.schoollink.net __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
ActiveX DLL to return a collection with CFOBJECT
Hi All, I'm a new subscriber to the list and about 3 projects new to CF. I recently posted a message but was unsure if it got to the rest of you. So please paron me if you receive this as a dubplicate. I am having trouble returning a collection with the cfobject command. Any help would be appreciated. I have an ActiveX Dll with the Prog-ID:ghZipLocator.clsghZipLocator inside that I have a method/function called GetCompanyNames. GetCompanyNames returns a recordset. Which works well in ASP. Here is my code for the getCompanyNames method in Prog-ID:ghZipLocator.clsghZipLocator. You will see it is very simple. Public Function getCompanyNames(ByVal strDsn As String, ByVal strDsnUserid As String, ByVal _ strDsnPasswd As String) As Variant On Error GoTo err1 Dim connlogin As New ADODB.Connection Dim rsResult As New ADODB.Recordset Dim sqlCompany As String connlogin.Open strDsn, strDsnUserid, strDsnPasswd sqlCompany = SELECT Company_Name, CompanyID _ FROM GH_COMPANY_INFO Set rsResult = connlogin.Execute(sqlCompany) Set getCompanyNames = rsResult Exit Function err1: Err.Raise Err.Number, Err.Source, Err.Description End Function Here is my CF code. CFSET dsnname = gHarvest CFSET dsnuser = sa CFSET dsnpass = CFOBJECT ACTION=Create NAME=obj CLASS=ghZipLocator.clsghZipLocator CFSET MyRecordset=obj.GetCompanyNames(#dsnname#,#dsnuser#,#dsnpass#) CFLOOP COLLECTION=#MyRecordset# ITEM=file2 CFOUTPUT #file2.Company_Name# /CFOUTPUT /CFLOOP Everything seem to work fine until it get to the loop. At this point I get the following error. unknown exception condition unknown error while executing a tag. I can send the VB project code if any of you think it may be helpful. If I am doing this incorrectly, an example of the correct procedure would be greatly appreciated. Thanks, David __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: ActiveX DLL to return a collection with CFOBJECT
Thanks, I was actually wondering that same thing. I was just about to try doing that. Changing the object to return an array I mean. Also I was wondering if anyone had an example of a component that does something similar to what I am trying to do. I don't want an proprietary information or anything. I just want to look at which references are assigned and how the methods and properties are laid out. Basically I want to see a component that for sure works with CF so that I can be sure of why mine do not. Thanks, Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 11:19 AM To: CF-Talk Subject: RE: ActiveX DLL to return a collection with CFOBJECT Looks like you're trying to handle the ADO recordset being returned like you would in ASP. Note that CF really doesn't know how to handle ADO recordsets - you'll probably want to write a wrapper object (or change the current one) to place the recordset into an array (which I *think* CF has no problem with) --- Billy Cravens -Original Message- From: David Jones [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 10:03 AM To: CF-Talk Subject: ActiveX DLL to return a collection with CFOBJECT Hi All, I'm a new subscriber to the list and about 3 projects new to CF. I recently posted a message but was unsure if it got to the rest of you. So please paron me if you receive this as a dubplicate. I am having trouble returning a collection with the cfobject command. Any help would be appreciated. I have an ActiveX Dll with the Prog-ID:ghZipLocator.clsghZipLocator inside that I have a method/function called GetCompanyNames. GetCompanyNames returns a recordset. Which works well in ASP. Here is my code for the getCompanyNames method in Prog-ID:ghZipLocator.clsghZipLocator. You will see it is very simple. Public Function getCompanyNames(ByVal strDsn As String, ByVal strDsnUserid As String, ByVal _ strDsnPasswd As String) As Variant On Error GoTo err1 Dim connlogin As New ADODB.Connection Dim rsResult As New ADODB.Recordset Dim sqlCompany As String connlogin.Open strDsn, strDsnUserid, strDsnPasswd sqlCompany = SELECT Company_Name, CompanyID _ FROM GH_COMPANY_INFO Set rsResult = connlogin.Execute(sqlCompany) Set getCompanyNames = rsResult Exit Function err1: Err.Raise Err.Number, Err.Source, Err.Description End Function Here is my CF code. CFSET dsnname = gHarvest CFSET dsnuser = sa CFSET dsnpass = CFOBJECT ACTION=Create NAME=obj CLASS=ghZipLocator.clsghZipLocator CFSET MyRecordset=obj.GetCompanyNames(#dsnname#,#dsnuser#,#dsnpass#) CFLOOP COLLECTION=#MyRecordset# ITEM=file2 CFOUTPUT #file2.Company_Name# /CFOUTPUT /CFLOOP Everything seem to work fine until it get to the loop. At this point I get the following error. unknown exception condition unknown error while executing a tag. I can send the VB project code if any of you think it may be helpful. If I am doing this incorrectly, an example of the correct procedure would be greatly appreciated. Thanks, David __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: ActiveX DLL to return a collection with CFOBJECT
Thanks, I'll do that. I don't absolutely have to use ADO, it just so happened that the component I picked to test with returned an ADO record set. To be honest, the components I write in the future will more than likely return arrays anyway. I believe this will help performance in the long haul when traffic picks up. I read some where that record sets take up more resources. I'll read up on it anyway though. I'm glad I found this list. Nothing is a better teacher than experience and I'm sure there is a lot of experience in here. I searched and search the web for help on my problem and didn't find anything except examples of things that didn't work for me.. Lol. Thanks, Dave -Original Message- From: Jon Hall [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 11:32 AM To: CF-Talk Subject: Re: ActiveX DLL to return a collection with CFOBJECT I don't have a solid answer but there area few things to keep in mind when working with COM with cfobject. CF pukes when you try to reference anything with a null value passed back from a com object. CF pukes if you reference a piece of data that is one of the less common datatypes in an ADO recordset (like sql server's decimal). I'm sure the list is a lot longer...I just know these two from experience. I will say that i've seen the exact problem you have more than once, and almost everytime it is because I am trying to reference a null. If you haven't already, go to http://www.cfcomet.com and read their write-up on using ADO from within CF and the comments in the forum. I have successfully used ADO with cfobject, but it can be very picky. The null problem alone can be a showstopper sometimes though. jon - Original Message - From: David Jones [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, April 26, 2002 11:02 AM Subject: ActiveX DLL to return a collection with CFOBJECT Hi All, I'm a new subscriber to the list and about 3 projects new to CF. I recently posted a message but was unsure if it got to the rest of you. So please paron me if you receive this as a dubplicate. I am having trouble returning a collection with the cfobject command. Any help would be appreciated. I have an ActiveX Dll with the Prog-ID:ghZipLocator.clsghZipLocator inside that I have a method/function called GetCompanyNames. GetCompanyNames returns a recordset. Which works well in ASP. snip Everything seem to work fine until it get to the loop. At this point I get the following error. unknown exception condition unknown error while executing a tag. I can send the VB project code if any of you think it may be helpful. If I am doing this incorrectly, an example of the correct procedure would be greatly appreciated. Thanks, David __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: ActiveX DLL to return a collection with CFOBJECT
Yeah I read this yesterday while looking for an answer to my problem. I almost tried it, just for the hell of it... I was able to get my component working to return an array. Thanks for everyone's advice. Dave. -Original Message- From: Joseph Thompson [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 12:37 PM To: CF-Talk Subject: Re: ActiveX DLL to return a collection with CFOBJECT For fun I converted the JavaScript ADO definitions into a CF include file and posted an example of running through a recordset that way... It may help? http://cfhub.com/advanced/ado/ Basically I want to see a component that for sure works with CF so that I can be sure of why mine do not. Thanks, Dave __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: List Manager response
test FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
ActiveX DLL to return a collection with CFOBJECT
I am having trouble returning a collection with the cfobject command. Any help would be appreciated. I have an ActiveX Dll with the Prog-ID:ghZipLocator.clsghZipLocator inside that I have a method/function called GetCompanyNames. GetCompanyNames returns a recordset. Which works well in ASP. Here is my code for the getCompanyNames method in Prog-ID:ghZipLocator.clsghZipLocator. You will see it is very simple. Public Function getCompanyNames(ByVal strDsn As String, ByVal strDsnUserid As String, ByVal _ strDsnPasswd As String) As Variant On Error GoTo err1 Dim connlogin As New ADODB.Connection Dim rsResult As New ADODB.Recordset Dim sqlCompany As String connlogin.Open strDsn, strDsnUserid, strDsnPasswd sqlCompany = SELECT Company_Name, CompanyID _ FROM GH_COMPANY_INFO Set rsResult = connlogin.Execute(sqlCompany) Set getCompanyNames = rsResult Exit Function err1: Err.Raise Err.Number, Err.Source, Err.Description End Function Here is my CF code. CFSET dsnname = gHarvest CFSET dsnuser = sa CFSET dsnpass = CFOBJECT ACTION=Create NAME=obj CLASS=ghZipLocator.clsghZipLocator CFSET MyRecordset=obj.GetCompanyNames(#dsnname#,#dsnuser#,#dsnpass#) CFLOOP COLLECTION=#MyRecordset# ITEM=file2 CFOUTPUT #file2.Company_Name# /CFOUTPUT /CFLOOP Everything seem to work fine until it get to the loop. At this point I get the following error. unknown exception condition unknown error while executing a tag. I can send the VB project code if any of you think it may be helpful. If I am doing this incorrectly, an example of the correct procedure would be greatly appreciated. Thanks, David __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists