Re: [KCFusion] Math JavaScript and CF output
I wouldn't swear to it but I think that JavaScript 1.1 back in the 4.0 days fields of the same name in a form created a collection under the form that could be accessed like so: for (i=0; i<= document.formname.subtotal.length; i++) { runningtotal += document.formname.subtotal[i].value } return runningtotal; Obviously you will want to calculate the runningtotal, but hopefully that will give an idea. Bryan - Original Message - From: "Keith Purtell" <[EMAIL PROTECTED]> To: "KCFusion" <[EMAIL PROTECTED]> Sent: Thursday, May 17, 2001 4:37 PM Subject: [KCFusion] Math JavaScript and CF output > I have a project where employees will choose items from a company store. > Each product on the page will have a description, price per item and > subtotal. This is presented as a Web form, dynamically generated out of a > product database. At the bottom of the page is a grand total and submit > button. When you go to one item and enter your quantity (the only user input > field that is not readonly), an OnChange multiplies unit price times > quantity to arrive at the subtotal, and also changes the grand total. > Here's my problem. The JavaScript I'm using to add all the subtotals > accommodates a fixed number of items. I don't know how to tell it to add > every form field named "subtotal" or if that's even possible. Since each > item is a table row inside CFOUTPUT, I can rig this to change each subtotal > field name to "subtotal_0", "subtotal_1", etc. But the JavaScript is at the > top of the page and loads before the server is finished outputting the > company store items. Anyone ever attempted something like this? Partial > code enclosed. > > > > Ordering (VantageMed Company Store) > > > > > > > marginwidth="10"> > > Ordering > > > BORDER="0"> > > > > name (product img link)desc > > > size / color / stylequantity SIZE="4" onChange="update(this.form)">ea TYPE="TEXT" NAME="unitcost" value="19.99" SIZE="6" READONLY> > > > This item total NOWRAP> SIZE="6" READONLY> > > > > > BORDER="0"> > > > > name (product img link)desc > > > size / color / stylequantity NAME="quantity_0" SIZE="4" onChange="update(this.form)"> NOWRAP>ea READONLY> > > > This item total NOWRAP> SIZE="6" READONLY> > > > > > BORDER="0"> > > Grand total > NAME="total" SIZE="6" READONLY> > > > > > > > > > > > > > > > > > > Keith Purtell, Web/Network Administrator > VantageMed Operations (Kansas City) > > CONFIDENTIALITY NOTICE: This email message, including any attachments, is > for the sole use of the intended recipient(s) and may contain confidential > and privileged information. Any unauthorized review, use, disclosure or > distribution is prohibited. If you are not the intended recipient, please > contact the sender by reply email and destroy all copies of the original > message. > > > > __ > The KCFusion.org list and website is hosted by Humankind Systems, Inc. > List Archives http://www.mail-archive.com/cf-list@kcfusion.org > Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] > To Subscribe mailto:[EMAIL PROTECTED] > To Unsubscribe mailto:[EMAIL PROTECTED] > > __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
[KCFusion] Math JavaScript and CF output
I have a project where employees will choose items from a company store. Each product on the page will have a description, price per item and subtotal. This is presented as a Web form, dynamically generated out of a product database. At the bottom of the page is a grand total and submit button. When you go to one item and enter your quantity (the only user input field that is not readonly), an OnChange multiplies unit price times quantity to arrive at the subtotal, and also changes the grand total. Here's my problem. The JavaScript I'm using to add all the subtotals accommodates a fixed number of items. I don't know how to tell it to add every form field named "subtotal" or if that's even possible. Since each item is a table row inside CFOUTPUT, I can rig this to change each subtotal field name to "subtotal_0", "subtotal_1", etc. But the JavaScript is at the top of the page and loads before the server is finished outputting the company store items. Anyone ever attempted something like this? Partial code enclosed. Ordering (VantageMed Company Store) Ordering name (product img link)desc size / color / stylequantity ea This item total name (product img link)desc size / color / stylequantity ea This item total Grand total Keith Purtell, Web/Network Administrator VantageMed Operations (Kansas City) CONFIDENTIALITY NOTICE: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] Sri Lanka virus
Here's the message I got about it, although I haven't received one of these messages yet. A new Visual Basic Script (VBS) virus named Mawanella is in the wild on the internet.This virus is propagated through email including Microsoft Outlook. A sample of the email the worm sends out is as follows: Subject: Mawanella Message Body: Mawanella is one of the Sri Lanka's Muslim Village Attachment: Mawanella.vbs After the worm sends out the email or if the infected system does not have Microsoft Outlook installed in it, the following message boxes are displayed: Please forward this to everyone Mawanella is one of the Sri Lanka's Muslim Village. This brutal incident happened here 2 Muslim Mosques & 100 Shops are burnt. I hat this incident, What about you? I can destroy your computer I didn't do that because I am a peace-loving citizen. _ Lee Brandt Systems Analyst Intertec Publishing voice: (913)967-7414 cell: (913)238-2921 fax: (913)514-9310 emails: [EMAIL PROTECTED] -Original Message- From: Keith Purtell [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 3:07 PM To: [EMAIL PROTECTED] Subject: [KCFusion] Sri Lanka virus http:[EMAIL PROTECTED] Keith Purtell, Web/Network Administrator VantageMed Operations (Kansas City) CONFIDENTIALITY NOTICE: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Nathan T Haley Sent: Thursday, May 17, 2001 2:14 PM To: '[EMAIL PROTECTED]' Subject: RE: [KCFusion] SQL table listing - Access Hey, Does anyone know about a virus having to do with "Sri Lanka"? __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
[KCFusion] Sri Lanka virus
http:[EMAIL PROTECTED] Keith Purtell, Web/Network Administrator VantageMed Operations (Kansas City) CONFIDENTIALITY NOTICE: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Nathan T Haley Sent: Thursday, May 17, 2001 2:14 PM To: '[EMAIL PROTECTED]' Subject: RE: [KCFusion] SQL table listing - Access Hey, Does anyone know about a virus having to do with "Sri Lanka"? __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] dynamic dropdowns
Thanks Randy!!! This worked like a charm. I'm not sure this gets said enough but this list is a very good source of information. Chris --- "Ellis, Randy" <[EMAIL PROTECTED]> wrote: > Here is a working solution I just created. If the > code is not clear, email > me with questions at [EMAIL PROTECTED] > > You will need to modify the code for your stored > procedures and default > values. > > > > States and Counties > > > > // Load every county from every state >DATASOURCE="StateCounty"> > SELECT CountyName, StateAbbr > FROM Counties > > >> > // Convert the CF Query data into Javascript > variables > topLevelVariable='StatesCounties'> > > function ChangeCounties(STAbbr, CountyNm) { > > nRows = StatesCounties.getRowCount(); > > var ctr = 0; > for (row = 0; row < nRows; ++row) { > if (STAbbr.value == StatesCounties.getField(row, > 'StateAbbr')) { > // Load the dropdown list with counties for the > state selected > CountyNm.options[ctr]=new > Option(StatesCounties.getField(row, > 'CountyName'),StatesCounties.getField(row, > 'CountyName')); > ctr++; > } > } > > return true; > > } > > > > > > > > Select StateName, StateAbbr > From States > Order By StateName > > > > > ONCHANGE="ChangeCounties(this.form.STAbbr, > this.form.CountyNm)"> > Select State > >VALUE="#States.StateAbbr#">#States.StateName# > > > > > Select County > > > > > > > > Hope this helps, > Randy Ellis > > -Original Message- > From: Chris [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 15, 2001 2:47 PM > To: KCFusion-List > Subject: [KCFusion] dynamic dropdowns > > > > We are working on a page that involves a state drop > down list and the counties in that state. We want > to > make it dynamic so when a user chooses Missouri, > just > the counties in Missouri are available. > > Here's what I got so far. On the onchange event for > the state drop down we are setting a variable called > favorite. If I declare an input whose name is > favorite you can see this getting changed each time > a > new state is chosen. How do I go about setting up > the > stored procedure to accept this variable as an > argument and reretrieve it each time the state is > changed? > > I've included my attempt at this but I'm not having > any luck. > > Thanks, > > Chris > > Transitional//EN"> > > > > type="text/javascript"> > function put() > { > option=document.forms[0].st_ct.options[document.forms[0].st_ct.selectedIndex > ].text > txt=option > document.forms[0].favorite.value=txt > } > > > > > > >datasource="#application.glopds#" > username="#application.glouser#" > returncode="NO"> > cfsqltype="CF_SQL_VARCHAR" > dbvarname="@as_code_type" > value="us_st_ct" > null="No"> > > > > > > > Whatever > > > > cellpadding="0"> > > Test the state/county drop > down > > > > State: > > > #trim(linkstate.code_id)#>selected> > > #linkstate.code_desc# > > > > > > > County: > > > > onChange= procedure="county_num_name" > > datasource="#application.glopds#" > > username="#application.glouser#" > > returncode="NO"> > >type="In" > > cfsqltype="CF_SQL_CHAR" > > dbvarname="@as_st_ct" > === message truncated === __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] SQL table listing - Access
Cute, but not the right kind of virus. Got it sorted, thanks. -Original Message- From: Daryl Banttari [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 2:37 PM To: [EMAIL PROTECTED] Subject: Re: [KCFusion] SQL table listing - Access http://www.google.com/search?q=sri+lanka+virus - Original Message - From: "Nathan T Haley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 17, 2001 2:13 PM Subject: RE: [KCFusion] SQL table listing - Access Hey, Does anyone know about a virus having to do with "Sri Lanka"? -Original Message- From: Ryan Block [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 2:13 PM To: '[EMAIL PROTECTED]' Subject: RE: [KCFusion] SQL table listing - Access But I still need to be able to access those columns to input data, even though they are empty. >>Why don't you do a count on the number of records in the table first. If >>the recordcount = 0 don't run the CF ColumnList program. Ryan __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
Re: [KCFusion] SQL table listing - Access
http://www.google.com/search?q=sri+lanka+virus - Original Message - From: "Nathan T Haley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 17, 2001 2:13 PM Subject: RE: [KCFusion] SQL table listing - Access Hey, Does anyone know about a virus having to do with "Sri Lanka"? -Original Message- From: Ryan Block [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 2:13 PM To: '[EMAIL PROTECTED]' Subject: RE: [KCFusion] SQL table listing - Access But I still need to be able to access those columns to input data, even though they are empty. >>Why don't you do a count on the number of records in the table first. If >>the recordcount = 0 don't run the CF ColumnList program. Ryan __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] SQL table listing
Ryan, Depending on how often you run update stats on the SQL database you might be able to use this. This will loop through all databases on sysdatabases and then get all the tables in the database and finally list all of the columns in the order they should be. DECLARE @ls_db varchar(255), @ls_sql varchar(255) SELECT @ls_db = null SELECT @ls_db = Min(name) FROM master.dbo.sysdatabases WHILE @ls_db is not null BEGIN SELECT @ls_db SELECT @ls_sql = 'select O.name, C.name from ' + @ls_db + '.dbo.sysobjects O join syscolumns C ON C.id = O.id where O.xtype = "U" order by O.name, C.colorder' EXEC ( @ls_sql) SELECT @ls_db = Min(name) FROM master.dbo.sysdatabases WHERE name > @ls_db END Again, good luck!!! Chris --- Ryan Hartwich <[EMAIL PROTECTED]> wrote: > Chris, > > Your SQL code to do a table lookup and extract the > column names works on SQL > 7 also. Thanks a lot! Any permutations to do > output all the table names in > a database/datasource? > > Ryan > > > > > __ > The KCFusion.org list and website is hosted by > Humankind Systems, Inc. > List Archives > http://www.mail-archive.com/cf-list@kcfusion.org > Questions, Comments or Glowing Praise.. > mailto:[EMAIL PROTECTED] > To Subscribe > mailto:[EMAIL PROTECTED] > To Unsubscribe > mailto:[EMAIL PROTECTED] > __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] SQL table listing - Access
Hey, Does anyone know about a virus having to do with "Sri Lanka"? -Original Message- From: Ryan Block [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 2:13 PM To: '[EMAIL PROTECTED]' Subject: RE: [KCFusion] SQL table listing - Access But I still need to be able to access those columns to input data, even though they are empty. >>Why don't you do a count on the number of records in the table first. If >>the recordcount = 0 don't run the CF ColumnList program. Ryan __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] SQL table listing - Access
But I still need to be able to access those columns to input data, even though they are empty. >>Why don't you do a count on the number of records in the table first. If >>the recordcount = 0 don't run the CF ColumnList program. Ryan __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] SQL table listing - Access
Why don't you do a count on the number of records in the table first. If the recordcount = 0 don't run the CF ColumnList program. __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] SQL table listing - Access
I looked at the custom tags below, but they need a fully qualified path to the database and must have DAO installed. So I'm still looking for an Access solution to get just the column names from a table through a cfquery. SELECT TOP 1 * FROM table, then getting column names using the CF ColumnList works as long as there is data in the table, but otherwise I get an error. If anyone has anymore ideas, I would appreciate it. Ryan Block -Original Message- From: Bryan LaPlante [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 11:48 AM To: [EMAIL PROTECTED] Subject: Re: [KCFusion] SQL table listing There are a couple of cfx tags in the DevEx that you can use for this if you have access to the server to install them. CFX_TABLE http://devex.allaire.com/developer/gallery/info.cfm?ID=CA347124-2830-11D4-AA 9700508B94F380&method=Full CF_TABLEFIELDS http://devex.allaire.com/developer/gallery/info.cfm?ID=CA347125-2830-11D4-AA 9700508B94F380&method=Full url's will probably wrap Bryan - Original Message - From: "Ryan Block" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 17, 2001 11:35 AM Subject: RE: [KCFusion] SQL table listing > I have another question about sql tables and columns. Besides the table > names, I also need to be able to get at the column names in an Access > database. The folowing code works, until I get a table with no data in it, > which yields a 37000 ODBC error. I've looked through Access system tables > and SQL references, but can't find out how to get column names within a > table. Someone please tell me what I am missing. > > Thanks again, > > Ryan Block > > > > Click the back button on your browser and select a valid table name. > > > > > SELECT TOP 1 * > FROM #tablename# > > > Below is a list of columns in the #tablename# > table. > Uncheck any columns that you do not want displayed on the next screen. > You may also enter a new column name that will be used when diplaying data > within this application. > > > > > > > > value="" checked> > #ColumnName# > > > > > > > > > > > > > > > > -Original Message- > From: Bryan LaPlante [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 15, 2001 11:48 AM > To: [EMAIL PROTECTED] > Subject: Re: [KCFusion] SQL table listing > > > If you want to look at all the object in the DB here is a little dynamic > table for doing that. > > > select * from msysobjects > > > > > #ColumnName# > > > > > > #Evaluate("QryResult." & "#CellValue#")# > > > > > > - Original Message - > From: "Ryan Block" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, May 15, 2001 11:01 AM > Subject: [KCFusion] SQL table listing > > > > I can't remember how to query a database to just return the names of the > > tables in a database (just using Access for now). I know that I have seen > > the syntax to do this somewhere, but can't find it. Thanks in advance. > > > > Ryan Block > > > > > > __ > > The KCFusion.org list and website is hosted by Humankind Systems, Inc. > > List Archives http://www.mail-archive.com/cf-list@kcfusion.org > > Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] > > To Subscribe mailto:[EMAIL PROTECTED] > > To Unsubscribe mailto:[EMAIL PROTECTED] > > > > > > > > __ > The KCFusion.org list and website is hosted by Humankind Systems, Inc. > List Archives http://www.mail-archive.com/cf-list@kcfusion.org > Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] > To Subscribe mailto:[EMAIL PROTECTED] > To Unsubscribe mailto:[EMAIL PROTECTED] > > > > __ > The KCFusion.org list and website is hosted by Humankind Systems, Inc. > List Archives http://www.mail-archive.com/cf-list@kcfusion.org > Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] > To Subscribe mailto:[EMAIL PROTECTED] > To Unsubscribe mailto:[EMAIL PROTECTED] > > __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mail
RE: [KCFusion] SQL table listing
This is what I have modified from what Bryan LaPlante sent me the other day. You'll have to modify some of this SQL statement to whatever it should be for SQL Server. This works with Access. Ryan Block SELECT name FROM msysobjects WHERE type =1 AND name NOT LIKE 'MSys%' Below is a list of tables in the #datasource# database. #name# -Original Message- From: Ryan Hartwich [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 1:45 PM To: [EMAIL PROTECTED] Subject: RE: [KCFusion] SQL table listing Chris, Your SQL code to do a table lookup and extract the column names works on SQL 7 also. Thanks a lot! Any permutations to do output all the table names in a database/datasource? Ryan __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] SQL table listing
Chris, Your SQL code to do a table lookup and extract the column names works on SQL 7 also. Thanks a lot! Any permutations to do output all the table names in a database/datasource? Ryan __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] SQL table listing
Ryan, This works on SQL Server 2000. You can get a specific table or set it up to look through them dynamically. select O.name, C.name from sysobjects O join syscolumns C ON C.id = O.id where O.xtype = 'U' and O.name = 'your table name here' order by C.colorder Good luck! Chris --- Ryan Hartwich <[EMAIL PROTECTED]> wrote: > Bryan & Chris, > > You have given us great insight into finding table & > column names in Access. > Do you have a way in SQL Server? I tried looking at > some of the sysobjects > type tables but they are pretty heavily populated > with strange data. > > Ryan > > > > __ > The KCFusion.org list and website is hosted by > Humankind Systems, Inc. > List Archives > http://www.mail-archive.com/cf-list@kcfusion.org > Questions, Comments or Glowing Praise.. > mailto:[EMAIL PROTECTED] > To Subscribe > mailto:[EMAIL PROTECTED] > To Unsubscribe > mailto:[EMAIL PROTECTED] > __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
Re: [KCFusion] SQL table listing
Look into the sp_tables and sp_columns stored procedures. - Original Message - From: "Ryan Hartwich" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 17, 2001 12:57 PM Subject: RE: [KCFusion] SQL table listing Bryan & Chris, You have given us great insight into finding table & column names in Access. Do you have a way in SQL Server? I tried looking at some of the sysobjects type tables but they are pretty heavily populated with strange data. Ryan __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] SQL table listing
Bryan & Chris, You have given us great insight into finding table & column names in Access. Do you have a way in SQL Server? I tried looking at some of the sysobjects type tables but they are pretty heavily populated with strange data. Ryan __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
Re: [KCFusion] SQL table listing
There are a couple of cfx tags in the DevEx that you can use for this if you have access to the server to install them. CFX_TABLE http://devex.allaire.com/developer/gallery/info.cfm?ID=CA347124-2830-11D4-AA 9700508B94F380&method=Full CF_TABLEFIELDS http://devex.allaire.com/developer/gallery/info.cfm?ID=CA347125-2830-11D4-AA 9700508B94F380&method=Full url's will probably wrap Bryan - Original Message - From: "Ryan Block" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 17, 2001 11:35 AM Subject: RE: [KCFusion] SQL table listing > I have another question about sql tables and columns. Besides the table > names, I also need to be able to get at the column names in an Access > database. The folowing code works, until I get a table with no data in it, > which yields a 37000 ODBC error. I've looked through Access system tables > and SQL references, but can't find out how to get column names within a > table. Someone please tell me what I am missing. > > Thanks again, > > Ryan Block > > > > Click the back button on your browser and select a valid table name. > > > > > SELECT TOP 1 * > FROM #tablename# > > > Below is a list of columns in the #tablename# > table. > Uncheck any columns that you do not want displayed on the next screen. > You may also enter a new column name that will be used when diplaying data > within this application. > > > > > > > > value="" checked> > #ColumnName# > > > > > > > > > > > > > > > > -Original Message- > From: Bryan LaPlante [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 15, 2001 11:48 AM > To: [EMAIL PROTECTED] > Subject: Re: [KCFusion] SQL table listing > > > If you want to look at all the object in the DB here is a little dynamic > table for doing that. > > > select * from msysobjects > > > > > #ColumnName# > > > > > > #Evaluate("QryResult." & "#CellValue#")# > > > > > > - Original Message - > From: "Ryan Block" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, May 15, 2001 11:01 AM > Subject: [KCFusion] SQL table listing > > > > I can't remember how to query a database to just return the names of the > > tables in a database (just using Access for now). I know that I have seen > > the syntax to do this somewhere, but can't find it. Thanks in advance. > > > > Ryan Block > > > > > > __ > > The KCFusion.org list and website is hosted by Humankind Systems, Inc. > > List Archives http://www.mail-archive.com/cf-list@kcfusion.org > > Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] > > To Subscribe mailto:[EMAIL PROTECTED] > > To Unsubscribe mailto:[EMAIL PROTECTED] > > > > > > > > __ > The KCFusion.org list and website is hosted by Humankind Systems, Inc. > List Archives http://www.mail-archive.com/cf-list@kcfusion.org > Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] > To Subscribe mailto:[EMAIL PROTECTED] > To Unsubscribe mailto:[EMAIL PROTECTED] > > > > __ > The KCFusion.org list and website is hosted by Humankind Systems, Inc. > List Archives http://www.mail-archive.com/cf-list@kcfusion.org > Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] > To Subscribe mailto:[EMAIL PROTECTED] > To Unsubscribe mailto:[EMAIL PROTECTED] > > __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] SQL table listing
I have another question about sql tables and columns. Besides the table names, I also need to be able to get at the column names in an Access database. The folowing code works, until I get a table with no data in it, which yields a 37000 ODBC error. I've looked through Access system tables and SQL references, but can't find out how to get column names within a table. Someone please tell me what I am missing. Thanks again, Ryan Block Click the back button on your browser and select a valid table name. SELECT TOP 1 * FROM #tablename# Below is a list of columns in the #tablename# table. Uncheck any columns that you do not want displayed on the next screen. You may also enter a new column name that will be used when diplaying data within this application. #ColumnName# -Original Message- From: Bryan LaPlante [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 15, 2001 11:48 AM To: [EMAIL PROTECTED] Subject: Re: [KCFusion] SQL table listing If you want to look at all the object in the DB here is a little dynamic table for doing that. select * from msysobjects #ColumnName# #Evaluate("QryResult." & "#CellValue#")# - Original Message - From: "Ryan Block" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, May 15, 2001 11:01 AM Subject: [KCFusion] SQL table listing > I can't remember how to query a database to just return the names of the > tables in a database (just using Access for now). I know that I have seen > the syntax to do this somewhere, but can't find it. Thanks in advance. > > Ryan Block > > > __ > The KCFusion.org list and website is hosted by Humankind Systems, Inc. > List Archives http://www.mail-archive.com/cf-list@kcfusion.org > Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] > To Subscribe mailto:[EMAIL PROTECTED] > To Unsubscribe mailto:[EMAIL PROTECTED] > > __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
[KCFusion] CFGrid: making data into links
I am a fairly new CF developer, and have a basic question. Is there a way to make data elements into links that are returned in a cfgrid? I've laid out the grid and columns, and tried specifying an href in the cfcolumn tag, but this doesn't work. I believe it is because I have two columns that need to have their data elements appear as links. Any help would be greatly appreciated. Nicole __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] dynamic dropdowns
Here is a working solution I just created. If the code is not clear, email me with questions at [EMAIL PROTECTED] You will need to modify the code for your stored procedures and default values. States and Counties // Load every county from every stateSELECT CountyName, StateAbbr FROM Counties // Convert the CF Query data into Javascript variables function ChangeCounties(STAbbr, CountyNm) { nRows = StatesCounties.getRowCount(); var ctr = 0; for (row = 0; row < nRows; ++row) { if (STAbbr.value == StatesCounties.getField(row, 'StateAbbr')) { // Load the dropdown list with counties for the state selected CountyNm.options[ctr]=new Option(StatesCounties.getField(row, 'CountyName'),StatesCounties.getField(row, 'CountyName')); ctr++; } } return true; } Select StateName, StateAbbr From States Order By StateName Select State #States.StateName# Select County Hope this helps, Randy Ellis -Original Message- From: Chris [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 15, 2001 2:47 PM To: KCFusion-List Subject: [KCFusion] dynamic dropdowns We are working on a page that involves a state drop down list and the counties in that state. We want to make it dynamic so when a user chooses Missouri, just the counties in Missouri are available. Here's what I got so far. On the onchange event for the state drop down we are setting a variable called favorite. If I declare an input whose name is favorite you can see this getting changed each time a new state is chosen. How do I go about setting up the stored procedure to accept this variable as an argument and reretrieve it each time the state is changed? I've included my attempt at this but I'm not having any luck. Thanks, Chris function put() { option=document.forms[0].st_ct.options[document.forms[0].st_ct.selectedIndex ].text txt=option document.forms[0].favorite.value=txt } Whatever Test the state/county drop down State: selected> #linkstate.code_desc# County: > selected> #linkcounty.county_name# __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] dynamic dropdowns
Actually, I just wrote something very like this just to see if I could. The goal in the exercise was to create dynamic lists that didn't require me to reload the page every time I needed an update. The algorithm is entirely in javascript, and works basically like this: You have two arrays, we'll call them "a" and "b". "a" looks like this: a[1] = "Color"a[2] = "Size"a[10] = "Red"a[11] = "Green"a[12] = "Blue"a[20] = "Small"a[21] = "Medium"a[22] = "Large" The numbering of "a" isn't significant...it's just how I like to keep them straight. Array "b" looks like this: b[1] = [10,11,12]b[2] = [20,21,22] The whole purpose of the "b" array is to show the relationship between the categories and the options...category 1 gets options 10, 11, 12, and so on. You could, naturally, alter this to States/Counties. In your form you have two empty select boxes, no options. Pre-load the first one with the categories (or states, in your case), then as the user clicks on an item it's ID determines which element of "b" is used, which determines which elements of "a" are used to build the options for the second list. You can find a demonstration (and the source code: View Source) at: http://64.129.2.117/demo/demonstratelist.htm Best regards, Bill MorrisIndependent Consultanthttp://64.129.2.117/consulting > >-Original Message- > >From: Chris[[EMAIL PROTECTED]] > >Date: Wednesday, May 16, 2001 11:17 AM > >To: KCFusion-List[[EMAIL PROTECTED]] > >Subject: [KCFusion] dynamic dropdowns > > > > > > > >We are working on a page that involves a state drop > >down list and the counties in that state. We want to > >make it dynamic so when a user chooses Missouri, just > >the counties in Missouri are available. > > > >Here's what I got so far. On the onchange event for > >the state drop down we are setting a variable called > >favorite. If I declare an input whose name is > >favorite you can see this getting changed each time a > >new state is chosen. How do I go about setting up the > >stored procedure to accept this variable as an > >argument and reretrieve it each time the state is > >changed? > > > >I've included my attempt at this but I'm not having > >any luck. Get your FREE download of MSN Explorer at http://explorer.msn.com __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] dynamic dropdowns
There are several ways to go about this, easiest would be using either the twoselectsrelated or activeselect custom tags, the drawback being that you would have to select all of the states and all of the counties out of the database into a specificly structured recordset to be used by the tags. Also, load time is sometimes an issue with either of these custom tags. Another way would be to put your page in a frameset with the main frame being your form, and a 1 pixel frame being a processing page. you would then have an on change on the first select that sends the value to the processing page through form submission, which runs the stored proc and populates the second select box. This works very well, but is more difficult to code as far as running your stored proc on the same page after the page has been sent to the browser, it isn't going to happen unless the page is re rendered, and you probably should stay away from that route. ColdFusion code is processed server side, so it won't be able to interact with the page the way you are asking. If you need some assistance with the frame method, I can give it to you, otherwise the 2 custom tags are available on the developers exchange. >-Original Message- >From: Chris[[EMAIL PROTECTED]] >Date: Wednesday, May 16, 2001 11:17 AM >To: KCFusion-List[[EMAIL PROTECTED]] >Subject: [KCFusion] dynamic dropdowns > > > >We are working on a page that involves a state drop >down list and the counties in that state. We want to >make it dynamic so when a user chooses Missouri, just >the counties in Missouri are available. > >Here's what I got so far. On the onchange event for >the state drop down we are setting a variable called >favorite. If I declare an input whose name is >favorite you can see this getting changed each time a >new state is chosen. How do I go about setting up the >stored procedure to accept this variable as an >argument and reretrieve it each time the state is >changed? > >I've included my attempt at this but I'm not having >any luck. > >Thanks, > >Chris > >Transitional//EN"> > > > > >function put() >{ >option=document.forms[0].st_ct.options[document.forms[0].st_ct.selectedI >ndex].text >txt=option >document.forms[0].favorite.value=txt >} > > > > > > > datasource="#application.glopds#" > username="#application.glouser#" > returncode="NO"> >cfsqltype="CF_SQL_VARCHAR" > dbvarname="@as_code_type" > value="us_st_ct" > null="No"> > > > > > > > Whatever > > > >cellpadding="0"> > > Test the state/county drop down > > > > State: > > >#trim(linkstate.code_id)#>selected> > #linkstate.code_desc# > > > > > > County: > > > >onChange=procedure="county_num_name" > datasource="#application.glopds#" > username="#application.glouser#" > returncode="NO"> > > cfsqltype="CF_SQL_CHAR" > dbvarname="@as_st_ct" > value=form.favorite > null="No"> > > > > > > > #linkcounty.county_num#>selected> > #linkcounty.county_name# > > > > > > > > > > > > > >__ >Do You Yahoo!? >Yahoo! Auctions - buy the things you want at great prices >http://auctions.yahoo.com/ > > >__ >The KCFusion.org list and website is hosted by Humankind Systems, Inc. >List Archives http://www.mail-archive.com/cf-list@kcfusion.org >Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] >To Subscribe mailto:[EMAIL PROTECTED] >To Unsubscribe mailto:[EMAIL PROTECTED] > > __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]