Confused about calling a function within a CFC

2004-05-30 Thread Michael Kear
I'm a bit confused about how to call a function inside a CFC by anther
function. 

I have a function called GETRANDID inside a cfc called utilities.cfc which
creates a random id number.It's access is 'Public because I have to call
it from several pages around the site. Now I am building another function
within the same CFC that does other jobs, but needs a RandomID.I want to
use the function GETRANDID to create the number, but how do I do it?Every
way I've tried gives me a very unhelpful Page could not be displayed
error, which tells me I've got it wrong but not what the problem is. 

Can anyone tell me how, within a function called RENDERLINKSI call the
other functioncalled GETRANDID ? 



Cheers

Mike Kear

AFP Webworks

Windsor, NSW, Australia

http://afpwebworks.com
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: ugly truth

2004-05-30 Thread Jochem van Dieten
Chunshen (Don) Li wrote:
 
 They are Dell 1550 for WEB server (IIS 5.0) and 2550 for Access 2000 (intend to upgrade to SQL Server) (they have a total of 4 boxes).

Never, ever run Access over a network share. You literally 
quadruple the failure modes when going from a local Access DB to 
one run over CIFS and performance will degrade.

Jochem
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: ugly truth

2004-05-30 Thread Philip Arnold
 From: Chunshen (Don) Li
 
 Client wants to run 30 concurrent users testing/training. 
 Still Access? And I don't want to argue with a client.

If they want to run 30 concurrent users, then you've got to tell the
client 2 things

1) Upgrade the memory

2) Upgrade from Access to a server level database rather than a user
level database

Try an analogy:
It's like trying to drive down the freeway/motorway in a go-kart

Having a single processor server with 256MB of RAM and expect it to
handle 30 concurrent request, and then running it on Access is a little
unrealistic

The (rough estimated) level of concurrent requests in CF5 is 4-5 per
processor - so you would need a 6-8 processor machine

Access ODBC handles 50 concurrent requests before it begins to throw
errors - that's 50 CFQUERY tags total - so for 30 concurrent requests,
you'd have 1.5 queries per page without cache!

You can't run a site of that amount of traffic on a box of that
specification

You also realise that if you don't argue with the client over this, when
it falls flat on it's face that they'll blame you, right?
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Confused about calling a function within a CFC

2004-05-30 Thread Raymond Camden
Just do cfset result = getRandID(). You call it like it was a UDF.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: ugly truth

2004-05-30 Thread Jochem van Dieten
Chunshen (Don) Li wrote:

 Client wants to run 30 concurrent users testing/training.

Lets suppose those 30 users each click a new page every 10 
seconds. That means 3 requests per second. Lets suppose a page 
takes 200 ms to process: you can still run everything over a 
single connection without having any concurrency issues.

You really need to do more work in establishing the true level of 
concurrency before you can asses whether Access can handle the job.

Jochem
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: ugly truth

2004-05-30 Thread Daniel Farmer
Agreed. Access might just very well be good enough.
- Original Message - 
From: Jochem van Dieten 
To: CF-Talk 
Sent: Sunday, May 30, 2004 9:05 AM
Subject: Re: ugly truth

Chunshen (Don) Li wrote:

 Client wants to run 30 concurrent users testing/training.

Lets suppose those 30 users each click a new page every 10 
seconds. That means 3 requests per second. Lets suppose a page 
takes 200 ms to process: you can still run everything over a 
single connection without having any concurrency issues.

You really need to do more work in establishing the true level of 
concurrency before you can asses whether Access can handle the job.

Jochem
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: CF-Talk: Digest every 4 hours

2004-05-30 Thread Jeffry Houser
cfscript
 GetRandId(Parameterlist);
/cfscript

Just like you would call any User Defined function inside a normal page.

At 09:01 AM 5/30/2004, you wrote:
Subject: Confused about calling a function within a CFC
From: Michael Kear [EMAIL PROTECTED]
Date: Sun, 30 May 2004 18:29:31 +1000
Thread: 
http://www.houseoffusion.com/cf_lists/index.cfm/method=messagesthreadid=32879forumid=4#164961

I'm a bit confused about how to call a function inside a CFC by anther
function.



I have a function called GETRANDID inside a cfc called utilities.cfc which
creates a random id number.It's access is 'Public because I have to call
it from several pages around the site. Now I am building another function
within the same CFC that does other jobs, but needs a RandomID.I want to
use the function GETRANDID to create the number, but how do I do it?Every
way I've tried gives me a very unhelpful Page could not be displayed
error, which tells me I've got it wrong but not what the problem is.



Can anyone tell me how, within a function called RENDERLINKSI call the
other functioncalled GETRANDID ?



--
Jeffry Houser, Web Developer, Writer, Songwriter, Recording Engineer
mailto:[EMAIL PROTECTED]
--
AIM: Reboog711| Phone: 1-203-379-0773
--
My Books: http://www.instantcoldfusion.com
Recording Music: http://www.fcfstudios.com
Original Energetic Acoustic Rock: http://www.farcryfly.com
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: CF-Talk: Digest every 4 hours

2004-05-30 Thread Paul Vernon
It looks like most people have covered the CF question but there is another
problem here aswell To address the page cannot be displayed problem so
you can see the error as CF intended, turn off friendly HTTP error pages in
IE Tools  Internet Options  Advanced

 
Paul
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: ugly truth

2004-05-30 Thread Don
Yes, update, client party and I ran a test on concurrent users (total = 3 concurrent users) early this morning (clicking on each function/button simultaneously), Access 2000 with current extremely low server memory capabity and query-extensive function, failed to execute some query for 1 or 2 users most of the time for each button/function. Though appreciate your input, but the general belief that Access does not or can't do a decent job on supporting concurrent users well is confirmed as far as I'm and my client for this project is concerned.In actual application use, yes, maybe, it's extremely rare that 3 concurrent users would hit the same button at the exact second, the theory below is unnecessary.But client's customers training session with 30 concurrent users hitting a same button would make you or anyone else cry (for or against Access) and that's part of client's contract with his customer.

So, on the db end for this project, I don't seek any further input, thank you.

Chunshen (Don) Li wrote:

 Client wants to run 30 concurrent users testing/training.

Lets suppose those 30 users each click a new page every 10 
seconds. That means 3 requests per second. Lets suppose a page 
takes 200 ms to process: you can still run everything over a 
single connection without having any concurrency issues.

You really need to do more work in establishing the true level of 
concurrency before you can asses whether Access can handle the job.

Jochem
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: the ever popular cflock best practice revisited

2004-05-30 Thread Don
Tom and Issac,

An update:
Early this morning's testing with my client (total of 3 concurrent users hitting same button/function simultaneously) seems to prove that
locking session variables with SCOPE of session attribute and TIMEOUT attribute value set according to an educated guess on the estimate of the execution time of content inside a lock WORKS WELL.

On cflock name=#createuuid()#, my guess is, cf server (be it 5x or 6x) may treat quasi variables, say, cflock with NAME attribute is one of them, as variable class, then, according to CF spec, variable name may not start with numeric value, then of course this type of NAMEd locking would fail, while cflock name=str#createuuid()# may be able to lock,
making sense? or do I need more coffee?Any MM cf server architecture dude here? to confirm or clarify?

Don

I love mud, Issac, :)
I think you made some valid points.To create a cf lock like 
cflock name='session' ... is totally and obviously senseless.

Don

http://www.sys-con.com/story/?storyid=44477DE=1
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: ugly truth

2004-05-30 Thread Don
Jochem,

Sorry about the tone of my last response to you.The project is good and my client is happy.

Don

Chunshen (Don) Li wrote:

 Client wants to run 30 concurrent users testing/training.

Lets suppose those 30 users each click a new page every 10 
seconds. That means 3 requests per second. Lets suppose a page 
takes 200 ms to process: you can still run everything over a 
single connection without having any concurrency issues.

You really need to do more work in establishing the true level of 
concurrency before you can asses whether Access can handle the job.

Jochem
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: ugly truth

2004-05-30 Thread Philip Arnold
 From: Chunshen (Don) Li
 
 Yes, update, client party and I ran a test on concurrent 
 users (total = 3 concurrent users) early this morning 
 (clicking on each function/button simultaneously), Access 
 2000 with current extremely low server memory capabity and 
 query-extensive function, failed to execute some query for 1 
 or 2 users most of the time for each button/function. Though 
 appreciate your input, but the general belief that Access 
 does not or can't do a decent job on supporting concurrent 
 users well is confirmed as far as I'm and my client for this 
 project is concerned.In actual application use, yes, maybe, 
 it's extremely rare that 3 concurrent users would hit the 
 same button at the exact second, the theory below is 
 unnecessary.But client's customers training session with 30 
 concurrent users hitting a same button would make you or 
 anyone else cry (for or against Access) and that's part of 
 client's contract with his customer.
 
 So, on the db end for this project, I don't seek any further 
 input, thank you.

Have you tried caching the queries that are returning the same data per
user?

It might ease the load on the ODBC driver
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: the ever popular cflock best practice revisited

2004-05-30 Thread Tom Kitta
I understand what Issac said in his post earlier, it makes sense that if
things work as he described then scope should be slower than name. However,
when I increased the loop counters by 10 and run from 3 different browsers
the prediction that Issac made don't check out. The browser that makes the
1st call is about even for name and scope. But the 2nd and 3rd show that
scope is 2 as fast as name. Now either there is still something wrong with
how I test it and one has to build a dedicated cflock testing system or we
still didn't get it.

As a side note, cflock seams to be one of the most misunderstood elements of
ColdFusion. There is not much information on it anywhere I looked. And when
I find something it conflicts with information elsewhere. By far I am not an
expert and don't spend my days looking at cflock, however, it would be nice
if MM posted detailed specifications in a KB somewhere (last time I looked I
didn't find anything).

TK
http://www.tomkitta.com
-Original Message-
From: Chunshen (Don) Li [mailto:[EMAIL PROTECTED]
Sent: Sunday, May 30, 2004 11:01 AM
To: CF-Talk
Subject: Re: the ever popular cflock best practice revisited

Tom and Issac,

An update:
Early this morning's testing with my client (total of 3 concurrent users
hitting same button/function simultaneously) seems to prove that
locking session variables with SCOPE of session attribute and TIMEOUT
attribute value set according to an educated guess on the estimate of the
execution time of content inside a lock WORKS WELL.

On cflock name=#createuuid()#, my guess is, cf server (be it 5x or
6x) may treat quasi variables, say, cflock with NAME attribute is one of
them, as variable class, then, according to CF spec, variable name may not
start with numeric value, then of course this type of NAMEd locking would
fail, while cflock name=str#createuuid()# may be able to lock,
making sense? or do I need more coffee?Any MM cf server architecture
dude here? to confirm or clarify?

Don
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: ugly truth

2004-05-30 Thread Claude Schneegans
256 MB RAM but it's true I just found out from my client.

Buy them an extra 512 MB, it will cost yoy les than the time you're spending questioning about the problem ;-)

--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Retrieving the delimited form field

2004-05-30 Thread Spectrum WebDesign
Hi all

this is my SELECT field form

select name=profs required=No 
optionPlease make choice/option
option value=30||MEDICINEMEDICINE/option
option value=107||WEB DEVELOPERWEB DEVELOPER/option
/select

How to retrieve the first and second vars? Maybe ideas, tips, best practices about how to make an smarter form...

Thanx in advance.
-- 
___
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: ugly truth

2004-05-30 Thread Claude Schneegans
Client wants to run 30 concurrent users testing/training. Still Access?

Sure! 30 concurrent users do not mean 30 concurrent queries, especially for users under training.

--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: ugly truth

2004-05-30 Thread Claude Schneegans
failed to execute some query for 1 or 2 users most of the time for each button/function.

It depends on what you mean by fail.
Having 3 concurrent queries in Access can make it take 1/2 second instead of 1/3 sec, but It CANNOT make it fail.
If it failed, (check for any error message), it might simply be a CFLOCK issue in the code, rather than an Access problem,
and upgrading to MSSQL won't solve the problem.

--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




parsing help for a slow learner

2004-05-30 Thread Seamus Campbell
Hi

I'm hoping some-one can help me.
I have to parse a file to insert data into a database, and I'm
stuck on the initial parsing. (I have some sort of mental block
when it comes to this sort of stuff)

A sample of the file is at the bottom of this email.

each record is starts with BOOS| and ends with BOOE|

At the moment I am reading the file, then replacing the BOOS|
with a ~ and looping thru the file using the new delimiter (~)
This way I can get each record but I can't seem to then get each
field.

I have tried:

CFFILE file=#myFile# action="" variable=myData
cfset myDelim = BOOS|
cfset myData = Replace(myData,myDelim,~,ALL)

cfloop index=myLine list=#myData# delimiters=~

cfloop index=myRecord list=#myLine#
delimiters=#Chr(10)##Chr(13)#

cfset Field = left(Trim(myLine),4)
cfset Data = "" |)) 
!--- Input data here ---

/cfloop
hr

/cfloop

But this seems to get BOOK and then the rest of the record ie
doesn't see a new line

Any help at all would be greatly appreciated 

Seamus


BOOS|
BOOK|04
TRAN|D
ANAM|ROTH, WALTER E.
TNAM|NORTH QUEENSLAND ETHNOGRAPHY Bulletin No.4 : GAMES, SPORTS AND
AMUSEMENTS
PBLS|Home Secretary's Department Brisbane, 1902
SUB1|ABORIGINAL CULTURE, AUSTRALIA HISTORY, NATIVE MONOGRAPHS, 19TH
CENTURY SPORTS
DESC|Good. 1st. 13.25 x 8.25. a Monograph of 39pp, illustrated by
photograph and drawings, the endpapers have browned and the
exceedingly plain covers have surface tarnish but a bright
interior on superior paper. Walter E.Roth was Queensland's
Northern Protector of Aboriginals previously he was Demy of
Magdalen College, Oxford.
PRIC|35
UPDT|10/05/2004
UPTM|12:44:38 PM
BCAT|Sold
ABLE|1
UBID|1
STAT|Sold
PPRC|0
PDSC|QLD
BOOE|
BOOS|
BOOK|15
TRAN|A
ANAM|Paul De Nooijer
TNAM|Magie in De Vleeshal : De Fotografie Van Paul De Nooijer
PBLS|Middleburg: Deze Publikatie, 1987
SUB1|PAUL DE NOOJIER, NETHERLANDS PHOTOGRAPHER, DUTCH PHOTOGRAPHY ,
DRAMATIC VISUAL ART
DESC|Illustrated Card. Very Good. 1st. Softcover. 8.5 x 9.25. 50pp
with triple expanding heart 111 Kleurprints. A major art work by
an icon Dutch photgrapher, covers a little rubbed. In all my work
I have wanted to involve the framework in the representation so as
to suggest what is taking place behind it.
PRIC|25
UPDT|8/05/2004
UPTM|1:36:35 PM
BCAT|Art
ABLE|1
UBID|3
STAT|For Sale
PPRC|0
PDSC|art
BOOE|
BOOS|
BOOK|18
TRAN|A
ANAM|A H Archibald Henry Rea, Illustrated by Max Cowper
TNAM|LINDORES ABBEY and It's Historic Associations
PBLS|Dundee: James P. Mathew, 1902
SUB1|LINDORES ABBEY, ECCLESIASTICAL ARCHITECTURE, SCOTTISH PILES
MAX COWPER
DESC|Illustrated Boards. Good. 1st. Travel and Historic Guide. 7.25
x 5. 153pp, a.e.g. rubs to the bottom extremities bumps to the
spine edges. 15 illus. and a ground plan. Of all the valleys in
Scotland, perhaps not one surpasses the valley of the Tay for
beauty of scenery, grandeur of surroundings, and wealth of places
famous in the annals of our country.
PRIC|20
UPDT|8/05/2004
UPTM|1:46:32 PM
BCAT|England / Ireland / Scotland / Wales
ABLE|1
UBID|4
STAT|For Sale
PPRC|0
PDSC|ENG
BOOE|
BOOS|
BOOK|22
TRAN|A
ANAM|NORMAN BUCHANAN
TNAM|Learn to Draw
PBLS|London: Frederick Warne, 1964
SUB1|ART EDUCATION, BECOMING AN ARTIST, LEARNING TO DRAW,
DESC|Illustrated Boards. Very Good/Fair. 1st. 11.25 x 8.5. 66pp,
d/w : worn, amateur repairs. clipped. Book : slight darkening of
the paper. sections include Ways and Means, Teaching Yourself -
Practical, Further Practice Out of Doors, Figure Drawing. One of
the ideas running through this book is that if a student can make
a really good drawing of a potato..
PRIC|22.5
UPDT|8/05/2004
UPTM|11:50:22 AM
BCAT|Art
ABLE|1
UBID|5
STAT|For Sale
PPRC|0
PDSC|art
BOOE|


Seamus CampbellBoldacious WebDesign
http://www.boldacious.com[EMAIL PROTECTED]
ph 02 6297 4883mob 0410 609 267
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Retrieving the delimited form field

2004-05-30 Thread Scott Brady
Spectrum WebDesign wrote:

 Hi all

 this is my SELECT field form

 select name=profs required=No 
 optionPlease make choice/option
 option value=30||MEDICINEMEDICINE/option
 option value=107||WEB DEVELOPERWEB DEVELOPER/option
 /select

 How to retrieve the first and second vars? Maybe ideas, tips, best 
 practices about how to make an smarter form...

You can use the List functions or GetToken() to split the values.

I haven't tried using || as a delimiter, but I often use a single pipe 
| as a delimeter, and that works just fine.

Scott

-- 
---
Scott Brady
http://www.scottbrady.net/
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Retrieving the delimited form field

2004-05-30 Thread Spectrum WebDesign
Yesss. Thanx Scott. Good Sunday...

- Original Message -
From: Scott Brady [EMAIL PROTECTED]
Date: Sun, 30 May 2004 10:08:22 -0600
To: CF-Talk [EMAIL PROTECTED]
Subject: Re: Retrieving the delimited form field

Spectrum WebDesign wrote:

 Hi all

 this is my SELECT field form

 select name=profs required=No 
 optionPlease make choice/option
 option value=30||MEDICINEMEDICINE/option
 option value=107||WEB DEVELOPERWEB DEVELOPER/option
 /select

 How to retrieve the first and second vars? Maybe ideas, tips, best 
 practices about how to make an smarter form...

You can use the List functions or GetToken() to split the values.

I haven't tried using || as a delimiter, but I often use a single pipe 
| as a delimeter, and that works just fine.

Scott

-- 
---
Scott Brady
http://www.scottbrady.net/
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: parsing help for a slow learner

2004-05-30 Thread Greg Luce
What database? Does this have to be done with CF on a recurring basis, or is
it a one-time thing? You should be able to do it with DTS if you're using
MSSQL.

Greg

-Original Message-
From: Seamus Campbell [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 30, 2004 11:47 AM
To: CF-Talk
Subject: parsing help for a slow learner

Hi

I'm hoping some-one can help me.
I have to parse a file to insert data into a database, and I'm
stuck on the initial parsing. (I have some sort of mental block
when it comes to this sort of stuff)

A sample of the file is at the bottom of this email.

each record is starts with BOOS| and ends with BOOE|

At the moment I am reading the file, then replacing the BOOS|
with a ~ and looping thru the file using the new delimiter (~)
This way I can get each record but I can't seem to then get each
field.

I have tried:

CFFILE file=#myFile# action="" variable=myData
cfset myDelim = BOOS|
cfset myData = Replace(myData,myDelim,~,ALL)

cfloop index=myLine list=#myData# delimiters=~

cfloop index=myRecord list=#myLine#
delimiters=#Chr(10)##Chr(13)#

cfset Field = left(Trim(myLine),4)
cfset Data = "" |)) 
!--- Input data here ---

/cfloop
hr

/cfloop

But this seems to get BOOK and then the rest of the record ie
doesn't see a new line

Any help at all would be greatly appreciated 

Seamus


BOOS|
BOOK|04
TRAN|D
ANAM|ROTH, WALTER E.
TNAM|NORTH QUEENSLAND ETHNOGRAPHY Bulletin No.4 : GAMES, SPORTS AND
AMUSEMENTS
PBLS|Home Secretary's Department Brisbane, 1902
SUB1|ABORIGINAL CULTURE, AUSTRALIA HISTORY, NATIVE MONOGRAPHS, 19TH
CENTURY SPORTS
DESC|Good. 1st. 13.25 x 8.25. a Monograph of 39pp, illustrated by
photograph and drawings, the endpapers have browned and the
exceedingly plain covers have surface tarnish but a bright
interior on superior paper. Walter E.Roth was Queensland's
Northern Protector of Aboriginals previously he was Demy of
Magdalen College, Oxford.
PRIC|35
UPDT|10/05/2004
UPTM|12:44:38 PM
BCAT|Sold
ABLE|1
UBID|1
STAT|Sold
PPRC|0
PDSC|QLD
BOOE|
BOOS|
BOOK|15
TRAN|A
ANAM|Paul De Nooijer
TNAM|Magie in De Vleeshal : De Fotografie Van Paul De Nooijer
PBLS|Middleburg: Deze Publikatie, 1987
SUB1|PAUL DE NOOJIER, NETHERLANDS PHOTOGRAPHER, DUTCH PHOTOGRAPHY ,
DRAMATIC VISUAL ART
DESC|Illustrated Card. Very Good. 1st. Softcover. 8.5 x 9.25. 50pp
with triple expanding heart 111 Kleurprints. A major art work by
an icon Dutch photgrapher, covers a little rubbed. In all my work
I have wanted to involve the framework in the representation so as
to suggest what is taking place behind it.
PRIC|25
UPDT|8/05/2004
UPTM|1:36:35 PM
BCAT|Art
ABLE|1
UBID|3
STAT|For Sale
PPRC|0
PDSC|art
BOOE|
BOOS|
BOOK|18
TRAN|A
ANAM|A H Archibald Henry Rea, Illustrated by Max Cowper
TNAM|LINDORES ABBEY and It's Historic Associations
PBLS|Dundee: James P. Mathew, 1902
SUB1|LINDORES ABBEY, ECCLESIASTICAL ARCHITECTURE, SCOTTISH PILES
MAX COWPER
DESC|Illustrated Boards. Good. 1st. Travel and Historic Guide. 7.25
x 5. 153pp, a.e.g. rubs to the bottom extremities bumps to the
spine edges. 15 illus. and a ground plan. Of all the valleys in
Scotland, perhaps not one surpasses the valley of the Tay for
beauty of scenery, grandeur of surroundings, and wealth of places
famous in the annals of our country.
PRIC|20
UPDT|8/05/2004
UPTM|1:46:32 PM
BCAT|England / Ireland / Scotland / Wales
ABLE|1
UBID|4
STAT|For Sale
PPRC|0
PDSC|ENG
BOOE|
BOOS|
BOOK|22
TRAN|A
ANAM|NORMAN BUCHANAN
TNAM|Learn to Draw
PBLS|London: Frederick Warne, 1964
SUB1|ART EDUCATION, BECOMING AN ARTIST, LEARNING TO DRAW,
DESC|Illustrated Boards. Very Good/Fair. 1st. 11.25 x 8.5. 66pp,
d/w : worn, amateur repairs. clipped. Book : slight darkening of
the paper. sections include Ways and Means, Teaching Yourself -
Practical, Further Practice Out of Doors, Figure Drawing. One of
the ideas running through this book is that if a student can make
a really good drawing of a potato..
PRIC|22.5
UPDT|8/05/2004
UPTM|11:50:22 AM
BCAT|Art
ABLE|1
UBID|5
STAT|For Sale
PPRC|0
PDSC|art
BOOE|


Seamus CampbellBoldacious WebDesign
http://www.boldacious.com[EMAIL PROTECTED]
ph 02 6297 4883mob 0410 609 267
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: parsing help for a slow learner

2004-05-30 Thread Ben Forta
Seamus,

 
This is a job for regular expressions. First of all, include this function
in your page (it returns a structure containing all matches):

 
!--- Like REFind(), but returns *all* matches ---
CFFUNCTION NAME=REFindAll OUTPUT=false RETURNTYPE=struct
CFARGUMENT NAME=regex TYPE=string REQUIRED=yes
CFARGUMENT NAME=text TYPE=string REQUIRED=yes

 
!--- Define local variables --- 
CFSET var results=StructNew()
CFSET var pos=1
CFSET var subex=
CFSET var done=FALSE

 
!--- Initialize results structure ---
CFSET results.len=ArrayNew(1)
CFSET results.pos=ArrayNew(1)

 
!--- Loop through text ---
CFLOOP CONDITION=NOT done

 
!--- Perform search ---
CFSET subex=REFind(ARGUMENTS.regex, ARGUMENTS.text, pos, TRUE)

 
!--- Anything matched? ---
CFIF subex.pos[1] IS 0
!--- Nothing found, outta here ---
CFSET done=TRUE
CFELSE
!--- Got one, add to arrays ---
CFSET ArrayAppend(results.len, subex.len[1])
CFSET ArrayAppend(results.pos, subex.pos[1])
!--- Reposition start point ---
CFSET pos=subex.pos[1]+subex.len[1]
/CFIF

 
/CFLOOP

 
!--- If no matches, add 0 to both arrays ---
CFIF ArrayLen(results.len) IS 0
CFSET ArrayAppend(results.len, 0)
CFSET ArrayAppend(results.pos, 0)
/CFIF

 
!--- And return results ---
CFRETURN results
/CFFUNCTION

 
Here is the processing itself:

 
!--- Get all records ---
CFSET records=REFindAll((BOOS\|).*?(BOOE\|), myData)

 
!--- Loop through them ---
CFLOOP INDEX=i FROM=1 TO=#ArrayLen(records.pos)#
 !--- Your per record processing goes here ---
 CFSET record=Mid(myData, records.pos[i], records.len[i])
 CFOUTPUT#record#/CFOUTPUT
 HR
/CFLOOP

 
The REFindAll() call gets the matches, and the CFLOOP loops through them.
Then just replace the processing in the loop with your own processing.

 
Hope this helps.

 
--- Ben



_

From: Seamus Campbell [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 30, 2004 11:47 AM
To: CF-Talk
Subject: parsing help for a slow learner

Hi

I'm hoping some-one can help me.
I have to parse a file to insert data into a database, and I'm
stuck on the initial parsing. (I have some sort of mental block
when it comes to this sort of stuff)

A sample of the file is at the bottom of this email.

each record is starts with BOOS| and ends with BOOE|

At the moment I am reading the file, then replacing the BOOS|
with a ~ and looping thru the file using the new delimiter (~)
This way I can get each record but I can't seem to then get each
field.

I have tried:

CFFILE file=#myFile# action="" variable=myData
cfset myDelim = BOOS|
cfset myData = Replace(myData,myDelim,~,ALL)

cfloop index=myLine list=#myData# delimiters=~

cfloop index=myRecord list=#myLine#
delimiters=#Chr(10)##Chr(13)#

cfset Field = left(Trim(myLine),4)
cfset Data = "" |)) 
!--- Input data here ---

/cfloop
hr

/cfloop

But this seems to get BOOK and then the rest of the record ie
doesn't see a new line

Any help at all would be greatly appreciated 

Seamus


BOOS|
BOOK|04
TRAN|D
ANAM|ROTH, WALTER E.
TNAM|NORTH QUEENSLAND ETHNOGRAPHY Bulletin No.4 : GAMES, SPORTS AND
AMUSEMENTS
PBLS|Home Secretary's Department Brisbane, 1902
SUB1|ABORIGINAL CULTURE, AUSTRALIA HISTORY, NATIVE MONOGRAPHS, 19TH
CENTURY SPORTS
DESC|Good. 1st. 13.25 x 8.25. a Monograph of 39pp, illustrated by
photograph and drawings, the endpapers have browned and the
exceedingly plain covers have surface tarnish but a bright
interior on superior paper. Walter E.Roth was Queensland's
Northern Protector of Aboriginals previously he was Demy of
Magdalen College, Oxford.
PRIC|35
UPDT|10/05/2004
UPTM|12:44:38 PM
BCAT|Sold
ABLE|1
UBID|1
STAT|Sold
PPRC|0
PDSC|QLD
BOOE|
BOOS|
BOOK|15
TRAN|A
ANAM|Paul De Nooijer
TNAM|Magie in De Vleeshal : De Fotografie Van Paul De Nooijer
PBLS|Middleburg: Deze Publikatie, 1987
SUB1|PAUL DE NOOJIER, NETHERLANDS PHOTOGRAPHER, DUTCH PHOTOGRAPHY ,
DRAMATIC VISUAL ART
DESC|Illustrated Card. Very Good. 1st. Softcover. 8.5 x 9.25. 50pp
with triple expanding heart 111 Kleurprints. A major art work by
an icon Dutch photgrapher, covers a little rubbed. In all my work
I have wanted to involve the framework in the representation so as
to suggest what is taking place behind it.
PRIC|25
UPDT|8/05/2004
UPTM|1:36:35 PM
BCAT|Art
ABLE|1
UBID|3
STAT|For Sale
PPRC|0
PDSC|art
BOOE|
BOOS|
BOOK|18
TRAN|A
ANAM|A H Archibald Henry Rea, Illustrated by Max Cowper
TNAM|LINDORES ABBEY and It's Historic Associations
PBLS|Dundee: James P. Mathew, 1902
SUB1|LINDORES ABBEY, ECCLESIASTICAL ARCHITECTURE, SCOTTISH PILES
MAX COWPER
DESC|Illustrated Boards. Good. 1st. Travel and Historic Guide. 7.25
x 5. 153pp, a.e.g. rubs to the bottom extremities bumps to the
spine edges. 15 illus. and a ground plan. Of all the valleys in
Scotland, perhaps not one surpasses the valley of the Tay for
beauty of scenery, grandeur of surroundings, and wealth of places
famous in the annals of our country.
PRIC|20
UPDT|8/05/2004
UPTM|1:46:32 PM
BCAT|England / Ireland / Scotland / Wales
ABLE|1
UBID|4
STAT|For Sale
PPRC|0

How do I track

2004-05-30 Thread JT
How do I track How long someone has viewed a coldfusion page...any ideas
would be apprciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Return text amount anding with a full word

2004-05-30 Thread Eric Creese
I want to return a portion of text provided the last word is the full word.

I understand I can use this SQL: select left(textfield,100) from table. But I want to get a whole last word not truncate it. I am sure this has been discussed before. 

Thanks Eric
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Return text amount anding with a full word

2004-05-30 Thread Eric Creese
Nevermind I found something.
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 12:43 PM
Subject: Return text amount anding with a full word

I want to return a portion of text provided the last word is the full word.

I understand I can use this SQL: select left(textfield,100) from table. But I want to get a whole last word not truncate it. I am sure this has been discussed before. 

Thanks Eric
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: How do I track

2004-05-30 Thread Daniel Farmer
you could set a session variable...

cfset session.timeFirstView = Now()

Then on an unload _javascript_ event...to detect when the page is left and have that 
trigger a second Now() CF function, then you'd have the start and end time.

- Original Message - 
From: JT 
To: CF-Talk 
Sent: Sunday, May 30, 2004 1:25 PM
Subject: How do I track 

How do I track How long someone has viewed a coldfusion page...any ideas
would be apprciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: How do I track

2004-05-30 Thread JT
Hum...

Why does this not work?

cfset session.timeFirstView = Now()

cfscript

pagetime = structnew()

pagetime.FirstView = session.firstTimeView

pagetime. ExitTime = onunload(now())

pagetime.Visited = pagetime.Visited - pagetime.Firstview

alert(time.Visited)

/cfscript

Any help preciated,

JT

-Original Message-
From: Daniel Farmer [mailto:[EMAIL PROTECTED]
Sent: Sunday, May 30, 2004 11:05 AM
To: CF-Talk
Subject: Re: How do I track

you could set a session variable...

cfset session.timeFirstView = Now()

Then on an unload _javascript_ event...to detect when the page is left and
have that
trigger a second Now() CF function, then you'd have the start and end
time.

 - Original Message -
 From: JT
 To: CF-Talk
 Sent: Sunday, May 30, 2004 1:25 PM
 Subject: How do I track

 How do I track How long someone has viewed a coldfusion page...any ideas
 would be apprciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




ImageMagic Tag

2004-05-30 Thread Qasim Rasheed
Hi everyone,

 
I am trying to incorporate cf_magictag. I have installed image magic
and when I tried to run the tag using the following syntax it ran
successfully and converted the file but give me following error. Any
thoughts

 
!--Tags usage
cf_magicktag inputtype=file 
 inputfile=#ExpandPath('image1.jpg')# 
 timeout=100 action="" outputType=file 
 outputFile=#ExpandPath('output1.jpg')# debug=yes 
 cf_magickaction action="" width=300 height=200
/cf_magicktag

 
!-Error Message

Error Diagnostic Information

Unexpected result. 

Upon completion of the MagickTag request, ImageMagick returned this
unexpected result: 

convert.exe: unable to open module file `C:\Program
Files\ImageMagick-6.0.1-Q16\modules\coders\IM_MOD_RL_EXE_.dll'. 

Use debug=yes to view debugging information.

The error occurred while processing an element with a general identifier
of (CFTHROW), occupying document position (434:4) to (438:61).

Date/Time: 05/30/04 15:14:57
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR
1.1.4322)
Remote Address: 127.0.0.1 

 
thanks 

 
Qasim Rasheed
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




DSN Connection issue

2004-05-30 Thread Eric Creese
I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: ugly truth

2004-05-30 Thread Don
Oops, mis-information, client most recently told me the cf server, IIS web server and Access db WERE on a same box. But good to be confirmed Access db on a separate box does not make any sense.

 Chunshen (Don) Li wrote:
  
  They are Dell 1550 for WEB server (IIS 5.0) and 2550 for Access 2000 
 (intend to upgrade to SQL Server) (they have a total of 4 boxes).
 
 Never, ever run Access over a network share. You literally 
 quadruple the failure modes when going from a local Access DB to 
 one run over CIFS and performance will degrade.
 
Jochem
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: ugly truth

2004-05-30 Thread Don
READ the original post FIRST before you respond!

 256 MB RAM but it's true I just found out from my client.
 
 Buy them an extra 512 MB, it will cost yoy les than the time you're 
 spending questioning about the problem ;-)
 
 --
 ___
 REUSE CODE! Use custom tags;
 See http://www.contentbox.com/claude/customtags/tagstore.cfm
 (Please send any spam to this address: [EMAIL PROTECTED])
 Thanks.

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: DSN Connection issue

2004-05-30 Thread Greg Luce
Try 127.0.0.1 instead of (local).

Greg

-Original Message-
From: Eric Creese [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 30, 2004 3:48 PM
To: CF-Talk
Subject: DSN Connection issue

I just put SQL Server 2000(Developer) on my development machine that is
running CFMX. I am trying to set up a datasource and it keeps failing. I
have a user set up in the database and that is all fine. I tried using
(local) for the server name and I also tried ERIC-T41383YGX5 which is what
the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: the ever popular cflock best practice revisited

2004-05-30 Thread Don
As a side note, cflock seams to be one of the most misunderstood elements of
ColdFusion. There is not much information on it anywhere I looked. And when
I find something it conflicts with information elsewhere. By far I am not an
expert and don't spend my days looking at cflock, however, it would be nice
if MM posted detailed specifications in a KB somewhere (last time I looked I
didn't find anything).

I was given one very useful URL on cflock for preCFMX and a link to CFMX
http://www.macromedia.com/support/coldfusion/ts/documents/tn17882.htm#5
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: ugly truth

2004-05-30 Thread Daniel Farmer
I say take them off the unix servers and install an asp emulator module on your Windows 3.1 server.
- Original Message - 
From: Chunshen (Don) Li 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:52 PM
Subject: Re: ugly truth

READ the original post FIRST before you respond!

 256 MB RAM but it's true I just found out from my client.
 
 Buy them an extra 512 MB, it will cost yoy les than the time you're 
 spending questioning about the problem ;-)
 
 --
 ___
 REUSE CODE! Use custom tags;
 See http://www.contentbox.com/claude/customtags/tagstore.cfm
 (Please send any spam to this address: [EMAIL PROTECTED])
 Thanks.

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Eric Creese
thanks but that did not work either here is the error.

Connection verification failed for data source: liberty
[]java.sql.SQLException: SQLException occurred in JDBCPool while attempting to connect, please check your username, password, URL, and other connectivity info.
The root cause was that: java.sql.SQLException: SQLException occurred in JDBCPool while attempting to connect, please check your username, password, URL, and other connectivity info
- Original Message - 
From: Greg Luce 
To: CF-Talk 
Sent: Sunday, May 30, 2004 2:56 PM
Subject: RE: DSN Connection issue

Try 127.0.0.1 instead of (local).

Greg

-Original Message-
From: Eric Creese [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 30, 2004 3:48 PM
To: CF-Talk
Subject: DSN Connection issue

I just put SQL Server 2000(Developer) on my development machine that is
running CFMX. I am trying to set up a datasource and it keeps failing. I
have a user set up in the database and that is all fine. I tried using
(local) for the server name and I also tried ERIC-T41383YGX5 which is what
the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Daniel Farmer
Did you create a datasource in the ODBC admin console?
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:48 PM
Subject: DSN Connection issue

I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Eric Creese
yes that is what I am trying to do, create a DSN in CF Admin
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:00 PM
Subject: Re: DSN Connection issue

Did you create a datasource in the ODBC admin console?
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:48 PM
 Subject: DSN Connection issue

 I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Daniel Farmer
No no, in the windows ODBC control panel 

Control Panel  Admin Tools  ODBC control panel
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:06 PM
Subject: Re: DSN Connection issue

yes that is what I am trying to do, create a DSN in CF Admin
 - Original Message - 
 From: Daniel Farmer 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:00 PM
 Subject: Re: DSN Connection issue

 Did you create a datasource in the ODBC admin console?
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:48 PM
Subject: DSN Connection issue

I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Eric Creese
nope why would i do that? I have never done that before? Even on my live server
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:05 PM
Subject: Re: DSN Connection issue

No no, in the windows ODBC control panel 

Control Panel  Admin Tools  ODBC control panel
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 4:06 PM
 Subject: Re: DSN Connection issue

 yes that is what I am trying to do, create a DSN in CF Admin
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:00 PM
Subject: Re: DSN Connection issue

Did you create a datasource in the ODBC admin console?
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:48 PM
Subject: DSN Connection issue

I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Daniel Farmer
BLAH AT !
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:10 PM
Subject: Re: DSN Connection issue

nope why would i do that? I have never done that before? Even on my live server
 - Original Message - 
 From: Daniel Farmer 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:05 PM
 Subject: Re: DSN Connection issue

 No no, in the windows ODBC control panel 

 Control Panel  Admin Tools  ODBC control panel
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:06 PM
Subject: Re: DSN Connection issue

yes that is what I am trying to do, create a DSN in CF Admin
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:00 PM
Subject: Re: DSN Connection issue

Did you create a datasource in the ODBC admin console?
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:48 PM
 Subject: DSN Connection issue

 I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Eric Creese
 What does that mean?
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:11 PM
Subject: Re: DSN Connection issue

BLAH AT !
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 4:10 PM
 Subject: Re: DSN Connection issue

 nope why would i do that? I have never done that before? Even on my live server
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:05 PM
Subject: Re: DSN Connection issue

No no, in the windows ODBC control panel 

Control Panel  Admin Tools  ODBC control panel
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:06 PM
Subject: Re: DSN Connection issue

yes that is what I am trying to do, create a DSN in CF Admin
 - Original Message - 
 From: Daniel Farmer 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:00 PM
 Subject: Re: DSN Connection issue

 Did you create a datasource in the ODBC admin console?
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:48 PM
Subject: DSN Connection issue

I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Daniel Farmer
It's been my experience that you must create a DSN in the ODBC control panel before you can add one in the coldfusion admin.
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:16 PM
Subject: Re: DSN Connection issue

 What does that mean?
 - Original Message - 
 From: Daniel Farmer 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:11 PM
 Subject: Re: DSN Connection issue

 BLAH AT !
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:10 PM
Subject: Re: DSN Connection issue

nope why would i do that? I have never done that before? Even on my live server
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:05 PM
Subject: Re: DSN Connection issue

No no, in the windows ODBC control panel 

Control Panel  Admin Tools  ODBC control panel
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 4:06 PM
 Subject: Re: DSN Connection issue

 yes that is what I am trying to do, create a DSN in CF Admin
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:00 PM
Subject: Re: DSN Connection issue

Did you create a datasource in the ODBC admin console?
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:48 PM
Subject: DSN Connection issue

I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Eric Creese
Ok I tried setting up a User ODBC Connection and when I didI got an error stating the user is not associated with a Trusted SQL Server Connection
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:11 PM
Subject: Re: DSN Connection issue

BLAH AT !
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 4:10 PM
 Subject: Re: DSN Connection issue

 nope why would i do that? I have never done that before? Even on my live server
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:05 PM
Subject: Re: DSN Connection issue

No no, in the windows ODBC control panel 

Control Panel  Admin Tools  ODBC control panel
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:06 PM
Subject: Re: DSN Connection issue

yes that is what I am trying to do, create a DSN in CF Admin
 - Original Message - 
 From: Daniel Farmer 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:00 PM
 Subject: Re: DSN Connection issue

 Did you create a datasource in the ODBC admin console?
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:48 PM
Subject: DSN Connection issue

I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Eric Creese
okay
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:17 PM
Subject: Re: DSN Connection issue

It's been my experience that you must create a DSN in the ODBC control panel before you can add one in the coldfusion admin.
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 4:16 PM
 Subject: Re: DSN Connection issue

  What does that mean?
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:11 PM
Subject: Re: DSN Connection issue

BLAH AT !
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:10 PM
Subject: Re: DSN Connection issue

nope why would i do that? I have never done that before? Even on my live server
 - Original Message - 
 From: Daniel Farmer 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:05 PM
 Subject: Re: DSN Connection issue

 No no, in the windows ODBC control panel 

 Control Panel  Admin Tools  ODBC control panel
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:06 PM
Subject: Re: DSN Connection issue

yes that is what I am trying to do, create a DSN in CF Admin
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:00 PM
Subject: Re: DSN Connection issue

Did you create a datasource in the ODBC admin console?
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:48 PM
 Subject: DSN Connection issue

 I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Eric Creese
BTW this is when I use a SQL password. If I use Windows NT credentials it is fine.
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:20 PM
Subject: Re: DSN Connection issue

Ok I tried setting up a User ODBC Connection and when I didI got an error stating the user is not associated with a Trusted SQL Server Connection
 - Original Message - 
 From: Daniel Farmer 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:11 PM
 Subject: Re: DSN Connection issue

 BLAH AT !
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:10 PM
Subject: Re: DSN Connection issue

nope why would i do that? I have never done that before? Even on my live server
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:05 PM
Subject: Re: DSN Connection issue

No no, in the windows ODBC control panel 

Control Panel  Admin Tools  ODBC control panel
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 4:06 PM
 Subject: Re: DSN Connection issue

 yes that is what I am trying to do, create a DSN in CF Admin
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:00 PM
Subject: Re: DSN Connection issue

Did you create a datasource in the ODBC admin console?
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:48 PM
Subject: DSN Connection issue

I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Daniel Farmer
Try a System DSN.
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:20 PM
Subject: Re: DSN Connection issue

Ok I tried setting up a User ODBC Connection and when I didI got an error stating the user is not associated with a Trusted SQL Server Connection
 - Original Message - 
 From: Daniel Farmer 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:11 PM
 Subject: Re: DSN Connection issue

 BLAH AT !
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:10 PM
Subject: Re: DSN Connection issue

nope why would i do that? I have never done that before? Even on my live server
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:05 PM
Subject: Re: DSN Connection issue

No no, in the windows ODBC control panel 

Control Panel  Admin Tools  ODBC control panel
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 4:06 PM
 Subject: Re: DSN Connection issue

 yes that is what I am trying to do, create a DSN in CF Admin
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:00 PM
Subject: Re: DSN Connection issue

Did you create a datasource in the ODBC admin console?
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:48 PM
Subject: DSN Connection issue

I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: DSN Connection issue

2004-05-30 Thread Eric Creese
ok I did this but got the same results as a user connection.I I use SQL username/password it has an error with a trusted connection if I use WindowsNt default then it works. However in the CF Admin it wants a username/password o I try a SQL username password for that db and it fails.
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:22 PM
Subject: Re: DSN Connection issue

Try a System DSN.
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 4:20 PM
 Subject: Re: DSN Connection issue

 Ok I tried setting up a User ODBC Connection and when I didI got an error stating the user is not associated with a Trusted SQL Server Connection
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:11 PM
Subject: Re: DSN Connection issue

BLAH AT !
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:10 PM
Subject: Re: DSN Connection issue

nope why would i do that? I have never done that before? Even on my live server
 - Original Message - 
 From: Daniel Farmer 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:05 PM
 Subject: Re: DSN Connection issue

 No no, in the windows ODBC control panel 

 Control Panel  Admin Tools  ODBC control panel
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:06 PM
Subject: Re: DSN Connection issue

yes that is what I am trying to do, create a DSN in CF Admin
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:00 PM
Subject: Re: DSN Connection issue

Did you create a datasource in the ODBC admin console?
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:48 PM
 Subject: DSN Connection issue

 I just put SQL Server 2000(Developer) on my development machine that is running CFMX. I am trying to set up a datasource and it keeps failing. I have a user set up in the database and that is all fine. I tried using (local) for the server name and I also tried ERIC-T41383YGX5 which is what the SQL Server Registrations is. Any help would be much appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: DSN Connection issue

2004-05-30 Thread Greg Luce
Have you used this same username/pw to connect through Query Analyzer?
That's one thing I do to verify the server name and login when in doubt.

-Original Message-
From: Eric Creese [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 30, 2004 4:22 PM
To: CF-Talk
Subject: Re: DSN Connection issue

BTW this is when I use a SQL password. If I use Windows NT credentials it is
fine.
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:20 PM
Subject: Re: DSN Connection issue

Ok I tried setting up a User ODBC Connection and when I didI got an
error stating the user is not associated with a Trusted SQL Server
Connection
 - Original Message - 
 From: Daniel Farmer 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 3:11 PM
 Subject: Re: DSN Connection issue

 BLAH AT !
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 4:10 PM
Subject: Re: DSN Connection issue

nope why would i do that? I have never done that before? Even on my
live server
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:05 PM
Subject: Re: DSN Connection issue

No no, in the windows ODBC control panel 

Control Panel  Admin Tools  ODBC control panel
 - Original Message - 
 From: Eric Creese 
 To: CF-Talk 
 Sent: Sunday, May 30, 2004 4:06 PM
 Subject: Re: DSN Connection issue

 yes that is what I am trying to do, create a DSN in CF Admin
- Original Message - 
From: Daniel Farmer 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:00 PM
Subject: Re: DSN Connection issue

Did you create a datasource in the ODBC admin console?
- Original Message - 
From: Eric Creese 
To: CF-Talk 
Sent: Sunday, May 30, 2004 3:48 PM
Subject: DSN Connection issue

I just put SQL Server 2000(Developer) on my development
machine that is running CFMX. I am trying to set up a datasource and it
keeps failing. I have a user set up in the database and that is all fine. I
tried using (local) for the server name and I also tried ERIC-T41383YGX5
which is what the SQL Server Registrations is. Any help would be much
appreciated.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Again Java CFX

2004-05-30 Thread Andrew Scott
Guy,

 
I am going to take it that you have not tried it and therefore don't know
what I am talking about. Or better still don't know what you are talking
about!

 
The IDe that I use automatically puts the package in for me... So if I move
it out of the intended directory the package is removed, if I put it into
the intended dir the package is placed into the java source file.

 
Either way CF does not like to traverse into a jar file looking for the cfx
tag?

Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485-Fax: 03 9699 7976

_

From: Guy Rish [mailto:[EMAIL PROTECTED] 
Sent: Friday, 28 May 2004 12:45 PM
To: CF-Talk
Subject: RE: Again Java CFX

Andrew,

There's the answer.
You aren't using the package in the class specification of the tag.

rish
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Again Java CFX

2004-05-30 Thread Guy Rish
Wow.
How very professional of you Andrew.

So let me understand this your IDE updates the ColdFusion administrator
settings for the CFX for you?What IDE is that - I think many of us would
like to know.
Perhaps you are merely frustrated with your situation and this is
complicated by the fact that I was not more clear.You must include the
complete package path for your CFX class in the class field of the CFX
registration in the ColdFusion administrator.I presumed that this was not
the case since it was not shown in the information that you provided when I
asked for it.

If you don't want the help you can ignore it - there really isn't any call
to be rude.

rish

-Original Message-
From: Andrew Scott [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 30, 2004 3:59 PM
To: CF-Talk
Subject: RE: Again Java CFX

Guy,

I am going to take it that you have not tried it and therefore don't know
what I am talking about. Or better still don't know what you are talking
about!

The IDe that I use automatically puts the package in for me... So if I move
it out of the intended directory the package is removed, if I put it into
the intended dir the package is placed into the java source file.

Either way CF does not like to traverse into a jar file looking for the cfx
tag?

Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485-Fax: 03 9699 7976

_

From: Guy Rish [mailto:[EMAIL PROTECTED] 
Sent: Friday, 28 May 2004 12:45 PM
To: CF-Talk
Subject: RE: Again Java CFX

Andrew,

There's the answer.
You aren't using the package in the class specification of the tag.

rish
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Again Java CFX

2004-05-30 Thread Andrew Scott
Guy

 
I was talking about the java package...

 
If I have the class file in a directory called nuImage with the package name
nuImage it will not be called from coldfusion.

 
Now in coldfusion admin I have typed the following

 
cfx_nuImageResize as the name of the tag
as for the class file the name is this
nuImageResize

 
For the above to work, the class file can't be were I want it but in the
root of the jar file.

 
I have also tried this

 
cfx_nuImageResize
nuImage.nuImageResize

 
as well as

 
cfx_nuImageResize
nuImage/nuImageResize

 
All with no results... 

 
If you think I am being un profressional then so be it, but I haver told you
it doesn't work..

 
If you have done the above then send me an example and instructions on how
to set your jar file up and I'll see who is loosing the plot here.

Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485-Fax: 03 9699 7976
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: parsing help for a slow learner

2004-05-30 Thread Claude Schneegans
As Ben said, this is a job for Reg expressions, and this is what CF_REExtrac is particulary good at:
The code would just be something like:

CF_REextract
 INPUTMODE= file
 INPUT= myFile
 RE1= BOOS\|
 RE2= BOOE\|
 OUTPUTMODE= query
 OUTPUT= myQuery
 

Then you would get all record in a field in query MyQuery

See REextract here: http://www.contentbox.com/claude/customtags/tagstore.cfm

--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




He3 community input (custom tag paths/mappings)

2004-05-30 Thread Matt Liotta
For various types of features we would like to implement in He3, we 
need the ability to locate files that are defined by runtime 
information which won't be available. Examples of this include 
resolving cfincludes, custom tag calls, and CFC dot notation 
references. One way to solve this is for projects in He3 to be 
configured with custom tag paths and mappings that match the settings 
in the target platform. That leads to a few implications. First, it 
requires the developer to actually configure information in a project. 
I know DWMX's project configuration annoyed me when I was used to just 
pointing Studio at a file system directory. Second, the project's 
settings could get out of sync with the target platform thus causing 
unexpected behavior.

Any thoughts on the proposed solution?

-Matt
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Again Java CFX

2004-05-30 Thread Guy Rish
Andrew,

*sigh*
For the sake of making a complete statement I will walk through the process
with you and perhaps we will discover what the problem is.

So I created a Java class in the following directory: C:\CFusionMX\cfx\rish
The Java class file name is: cfxhello.java
The source for that class is:

	package rish;

	import com.allaire.cfx.*;

	public class cfxhello implements CustomTag
	{
		public void processRequest(Request request, Response
response)
		{
			response.write(Hello, World);
		}
	}

I then created a JAR containing this class.From the command line in the
C:\CFusionMX\cfx directory I executed this command: jar cvf rish.jar
rish\*.class
I can verify that the JAR was created with the correct pathing by executing
this command: jar tvf rish.jar

I then registered the JAR into the ColdFusion Server's classpath by
including that JAR file in the Class Path field of the ColdFusion
Administrator's Java and JVM page.

I then registered the CFX tag with the following fields -
Tag Name: cfx_hello
Class Name: rish.cfxhello
Description: -

I then created a template called Andrew which looks like this:

cfx_hello

And behold it works!

Important items to note:
1. You must make certain that class gets added into your JAR correctly.
2. You must make certain that the JAR exists in the Server's classpath.
Automatically assuming it will just get pickup because it was dropped in a
directory will *not* suffice.
3. You must make certain that the CFX class name contains the fully
qualified package path to the class.

Additionally it is presumed that you have actually debugged the CFX.You
might consider using the debugging classes that are a part of the CFX API.
Once the class loading problems have been solved you might also encounter
some problems in the construction of your class.

I presume that I have been sufficiently clear about the process so as to
appeal to your more professional aspect.
Perhaps you will find it within yourself to give me the same courtesy.

rish

-Original Message-
From: Andrew Scott [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 30, 2004 4:48 PM
To: CF-Talk
Subject: RE: Again Java CFX

Guy

I was talking about the java package...

If I have the class file in a directory called nuImage with the package name
nuImage it will not be called from coldfusion.

Now in coldfusion admin I have typed the following

cfx_nuImageResize as the name of the tag
as for the class file the name is this
nuImageResize

For the above to work, the class file can't be were I want it but in the
root of the jar file.

I have also tried this

cfx_nuImageResize
nuImage.nuImageResize

as well as

cfx_nuImageResize
nuImage/nuImageResize

All with no results... 

If you think I am being un profressional then so be it, but I haver told you
it doesn't work..

If you have done the above then send me an example and instructions on how
to set your jar file up and I'll see who is loosing the plot here.

Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485-Fax: 03 9699 7976
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




[Reply To] RE: parsing help for a slow learner

2004-05-30 Thread Seamus Campbell
No - it's Access and has to be done regularly
seamus

 You wrote 
What database? Does this have to be done with CF on a recurring
basis, or is
it a one-time thing? You should be able to do it with DTS if
you're using
MSSQL.

Greg

-Original Message-
From: Seamus Campbell [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 30, 2004 11:47 AM
To: CF-Talk
Subject: parsing help for a slow learner

Hi

I'm hoping some-one can help me.
I have to parse a file to insert data into a database, and I'm

stuck on the initial parsing. (I have some sort of mental block

when it comes to this sort of stuff)

A sample of the file is at the bottom of this email.

each record is starts with BOOS| and ends with BOOE|

At the moment I am reading the file, then replacing the BOOS|
with a ~ and looping thru the file using the new delimiter (~)
This way I can get each record but I can't seem to then get each

field.

I have tried:

CFFILE file=#myFile# action="" variable=myData
cfset myDelim = BOOS|
cfset myData = Replace(myData,myDelim,~,ALL)

cfloop index=myLine list=#myData# delimiters=~

cfloop index=myRecord list=#myLine#
delimiters=#Chr(10)##Chr(13)#

cfset Field = left(Trim(myLine),4)
cfset Data = "" |)) 
!--- Input data here ---


/cfloop
hr

/cfloop

But this seems to get BOOK and then the rest of the record ie
doesn't see a new line

Any help at all would be greatly appreciated 

Seamus


BOOS|
BOOK|04
TRAN|D
ANAM|ROTH, WALTER E.
TNAM|NORTH QUEENSLAND ETHNOGRAPHY Bulletin No.4 : GAMES, SPORTS
AND
AMUSEMENTS
PBLS|Home Secretary's Department Brisbane, 1902
SUB1|ABORIGINAL CULTURE, AUSTRALIA HISTORY, NATIVE MONOGRAPHS,
19TH
CENTURY SPORTS
DESC|Good. 1st. 13.25 x 8.25. a Monograph of 39pp, illustrated by

 
photograph and drawings, the endpapers have browned and the
exceedingly plain covers have surface tarnish but a bright
interior on superior paper. Walter E.Roth was Queensland's
Northern Protector of Aboriginals previously he was Demy of

Magdalen College, Oxford.
PRIC|35
UPDT|10/05/2004
UPTM|12:44:38 PM
BCAT|Sold
ABLE|1
UBID|1
STAT|Sold
PPRC|0
PDSC|QLD
BOOE|
BOOS|
BOOK|15
TRAN|A
ANAM|Paul De Nooijer
TNAM|Magie in De Vleeshal : De Fotografie Van Paul De Nooijer
PBLS|Middleburg: Deze Publikatie, 1987
SUB1|PAUL DE NOOJIER, NETHERLANDS PHOTOGRAPHER, DUTCH PHOTOGRAPHY
,
DRAMATIC VISUAL ART
DESC|Illustrated Card. Very Good. 1st. Softcover. 8.5 x 9.25.
50pp
with triple expanding heart 111 Kleurprints. A major art work
by
an icon Dutch photgrapher, covers a little rubbed. In all my
work
I have wanted to involve the framework in the representation so
as
to suggest what is taking place behind it.
PRIC|25
UPDT|8/05/2004
UPTM|1:36:35 PM
BCAT|Art
ABLE|1
UBID|3
STAT|For Sale
PPRC|0
PDSC|art
BOOE|
BOOS|
BOOK|18
TRAN|A
ANAM|A H Archibald Henry Rea, Illustrated by Max Cowper
TNAM|LINDORES ABBEY and It's Historic Associations
PBLS|Dundee: James P. Mathew, 1902
SUB1|LINDORES ABBEY, ECCLESIASTICAL ARCHITECTURE, SCOTTISH PILES

MAX COWPER
DESC|Illustrated Boards. Good. 1st. Travel and Historic Guide.
7.25
x 5. 153pp, a.e.g. rubs to the bottom extremities bumps to the

spine edges. 15 illus. and a ground plan. Of all the valleys in

Scotland, perhaps not one surpasses the valley of the Tay for
beauty of scenery, grandeur of surroundings, and wealth of places

 
famous in the annals of our country.
PRIC|20
UPDT|8/05/2004
UPTM|1:46:32 PM
BCAT|England / Ireland / Scotland / Wales
ABLE|1
UBID|4
STAT|For Sale
PPRC|0
PDSC|ENG
BOOE|
BOOS|
BOOK|22
TRAN|A
ANAM|NORMAN BUCHANAN
TNAM|Learn to Draw
PBLS|London: Frederick Warne, 1964
SUB1|ART EDUCATION, BECOMING AN ARTIST, LEARNING TO DRAW,
DESC|Illustrated Boards. Very Good/Fair. 1st. 11.25 x 8.5. 66pp,

d/w : worn, amateur repairs. clipped. Book : slight darkening of

the paper. sections include Ways and Means, Teaching Yourself -

Practical, Further Practice Out of Doors, Figure Drawing. One of

 
the ideas running through this book is that if a student can make

 
a really good drawing of a potato..
PRIC|22.5
UPDT|8/05/2004
UPTM|11:50:22 AM
BCAT|Art
ABLE|1
UBID|5
STAT|For Sale
PPRC|0
PDSC|art
BOOE|



Seamus CampbellBoldacious WebDesign
http://www.boldacious.com[EMAIL PROTECTED]
ph 02 6297 4883mob 0410 609 267






 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




[Reply To] RE: parsing help for a slow learner

2004-05-30 Thread Seamus Campbell
Thanks Ben. That's a wonderful piece of code (most of which I'm
still trying to understand!)
I feel really stupid now but I'm still stuck.
I added your code and can now get the below.

I can't see how to get each field out of each record to input
into the database. I can see each record is a list with delimiters
of BOOK|, TRAN| ANAM| etc but I can't see how to use these
delimiters to get each field (does that make sense?)

Any help or clues would be great.


BOOS| BOOK|04 TRAN|D ANAM|ROTH, WALTER E. TNAM|NORTH QUEENSLAND
ETHNOGRAPHY Bulletin No.4 : GAMES, SPORTS AND AMUSEMENTS PBLS|Home
Secretary's Department Brisbane, 1902 SUB1|ABORIGINAL CULTURE,
AUSTRALIA HISTORY, NATIVE MONOGRAPHS, 19TH CENTURY SPORTS
DESC|Good. 1st. 13.25 x 8.25. a Monograph of 39pp, illustrated by
photograph and drawings, the endpapers have browned and the
exceedingly plain covers have surface tarnish but a bright
interior on superior paper. Walter E.Roth was Queensland's
Northern Protector of Aboriginals previously he was Demy of
Magdalen College, Oxford. PRIC|35 UPDT|10/05/2004 UPTM|12:44:38
PM BCAT|Sold ABLE|1 UBID|1 STAT|Sold PPRC|0 PDSC|QLD BOOE|
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Again Java CFX

2004-05-30 Thread Andrew Scott
Guy

 
That is excatly what I have been doing right from the word go

 
And here is the error message I get

 
in answer to you points...

1) It is in the jar correctly, because I can
CreateObject(java,nuImage.nuImageResize);
2) If that is a dig then its not funny, I mentioned dragging in my IDE which
automaticall places the word package into the file.
3) well enough said

 
Yes I have debugged the class file, as I said if it is not in the directory
(package nuImage) and in the root of the jar file it works fine.

 
Now like I said apart from that samll part it all works fine.


Error processing CFX custom tag quot;CFX_nuImage.nuImageResizequot;. 

The CFX custom tag CFX_nuImage.nuImageResize was not found in the custom
tag database. Please be sure to add custom tags to the database before using
them. If you have added your tag to the database then you should check the
spelling of the tag within your template to insure that it matches the
database entry. 	

Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485-Fax: 03 9699 7976

_

From: Guy Rish [mailto:[EMAIL PROTECTED] 
Sent: Monday, 31 May 2004 8:18 AM
To: CF-Talk
Subject: RE: Again Java CFX

Andrew,

*sigh*
For the sake of making a complete statement I will walk through the process
with you and perhaps we will discover what the problem is.

So I created a Java class in the following directory: C:\CFusionMX\cfx\rish
The Java class file name is: cfxhello.java
The source for that class is:

package rish;

import com.allaire.cfx.*;

public class cfxhello implements CustomTag
{
public void processRequest(Request request, Response
response)
{
response.write(Hello, World);
}
}

I then created a JAR containing this class.From the command line in the
C:\CFusionMX\cfx directory I executed this command: jar cvf rish.jar
rish\*.class
I can verify that the JAR was created with the correct pathing by executing
this command: jar tvf rish.jar

I then registered the JAR into the ColdFusion Server's classpath by
including that JAR file in the Class Path field of the ColdFusion
Administrator's Java and JVM page.

I then registered the CFX tag with the following fields -
Tag Name: cfx_hello
Class Name: rish.cfxhello
Description: -

I then created a template called Andrew which looks like this:

cfx_hello

And behold it works!

Important items to note:
1. You must make certain that class gets added into your JAR correctly.
2. You must make certain that the JAR exists in the Server's classpath.
Automatically assuming it will just get pickup because it was dropped in a
directory will *not* suffice.
3. You must make certain that the CFX class name contains the fully
qualified package path to the class.

Additionally it is presumed that you have actually debugged the CFX.You
might consider using the debugging classes that are a part of the CFX API.
Once the class loading problems have been solved you might also encounter
some problems in the construction of your class.

I presume that I have been sufficiently clear about the process so as to
appeal to your more professional aspect.
Perhaps you will find it within yourself to give me the same courtesy.

rish

-Original Message-
From: Andrew Scott [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 30, 2004 4:48 PM
To: CF-Talk
Subject: RE: Again Java CFX

Guy

I was talking about the java package...

If I have the class file in a directory called nuImage with the package name
nuImage it will not be called from coldfusion.

Now in coldfusion admin I have typed the following

cfx_nuImageResize as the name of the tag
as for the class file the name is this
nuImageResize

For the above to work, the class file can't be were I want it but in the
root of the jar file.

I have also tried this

cfx_nuImageResize
nuImage.nuImageResize

as well as

cfx_nuImageResize
nuImage/nuImageResize

All with no results... 

If you think I am being un profressional then so be it, but I haver told you
it doesn't work..

If you have done the above then send me an example and instructions on how
to set your jar file up and I'll see who is loosing the plot here.

Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485-Fax: 03 9699 7976 
_
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Again Java CFX

2004-05-30 Thread Paul Vernon
Not wanting to ask a stupid question or land myself in the middle of what
seems to be an interesting thread :) but..

 
Have you registered CFX_nuImage.nuImageResize or CFX_nuImage in the admin
area and how are you calling the tag in your cfm template

 
Paul
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Again Java CFX

2004-05-30 Thread Andrew Scott
Paul,

 
Yes I have and I know I said that!

 
Anyway what I thought I would do is install CF on my local machine and test
it, bingo it does work...

 
Seems that there is a problem with the development server that is going to
need looking at why it didn't work there.

 
Anyway Guy thanks for your help, you were frustrating me because I had done
everything you thought I hadn't done.

Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485-Fax: 03 9699 7976
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: parsing help for a slow learner

2004-05-30 Thread Aaron DC
Hi Seamus

You have a few people helping you already, but I thought I would share how I would do this for a different perspective: basically, I ask myself how would I do this manually, then map the process to code. I guess it helps to be able to think like a computer, but I digress.

An alternative to the dynamic SQL generation is provided using [ ] instad of  .

Step 0: Get access to the file
CFFILE ACTION="" VARIABLE=inFile etc etc

Step 1: process each line
This step includes recognizing that each piece of information is on a separate line (Chr(13)Chr(10)), and that on each line we have the metadata (BOOS, ANAM, TNAM, etc), separated from the data with a | character. NB: I treat things (everything!) as a list. I don't/can't do regex in my head, I do lists.

[CFSET Record = StructNew()]

CFLOOP LIST=#inFile# DELIMITERS=#chr(10)# INDEX=aLine

Step 2: recognize records:
This step includes grabbing the metadata for subsequent use
Start = BOOS|
End = BOOE|

 CFSET Meta = ListFirst(aLine, |)

Just for fun (to handle a simple potential problem of missing fields/data), we will dynamically create the insert SQL statement as we go. To do this we will need 2 strings - the field list and the value list. We may as well initialize them at the start of a record. 

NB: to keep it simple, we are also going to treat all fields as string. You can modify this process as you see fit.

 CFIF Meta EQ BOOS
CFSET FieldList = 
CFSET ValueList = 

[CFSET junk = StructClear(Record)]

If it's the end of the record, we should insert it into the database...

 CFELSEIF Meta EQ BOOE
CFQUERY DATASOURCE=etc etc
INSERT INTO Books (#FieldLIst#) VALUES (#ValueLIst#)
/CFQUERY

[Do your data insert here, using the key/value data from the Record struct]

Step 3: recognize fields
We have tested for start and end of record, everything else is assumed to be a field: build up the field and value lists accordingly...

 CFELSE
CFSET FieldData = Trim(ListRest(aLine, |))
CFSET FieldList = ListAppend(FieldList, Meta)
CFSET ValueList = ListAppend(ValueList, '#FieldData#')

[CFSET junk = StructInsert(Record, Meta, FieldData)]
 /CFIF

/CFLOOP

That will pretty much do want you want.

HTH 
Aaron

- Original Message - 
From: Seamus Campbell 
To: CF-Talk 
Sent: Monday, May 31, 2004 1:46 AM
Subject: parsing help for a slow learner

Hi

I'm hoping some-one can help me.
I have to parse a file to insert data into a database, and I'm
stuck on the initial parsing. (I have some sort of mental block
when it comes to this sort of stuff)

A sample of the file is at the bottom of this email.

each record is starts with BOOS| and ends with BOOE|

At the moment I am reading the file, then replacing the BOOS|
with a ~ and looping thru the file using the new delimiter (~)
This way I can get each record but I can't seem to then get each
field.

I have tried:

CFFILE file=#myFile# action="" variable=myData
cfset myDelim = BOOS|
cfset myData = Replace(myData,myDelim,~,ALL)

cfloop index=myLine list=#myData# delimiters=~

cfloop index=myRecord list=#myLine#
delimiters=#Chr(10)##Chr(13)#

cfset Field = left(Trim(myLine),4)
cfset Data = "" |)) 
!--- Input data here ---

/cfloop
hr

/cfloop

But this seems to get BOOK and then the rest of the record ie
doesn't see a new line

Any help at all would be greatly appreciated 

Seamus


BOOS|
BOOK|04
TRAN|D
ANAM|ROTH, WALTER E.
TNAM|NORTH QUEENSLAND ETHNOGRAPHY Bulletin No.4 : GAMES, SPORTS AND
AMUSEMENTS
PBLS|Home Secretary's Department Brisbane, 1902
SUB1|ABORIGINAL CULTURE, AUSTRALIA HISTORY, NATIVE MONOGRAPHS, 19TH
CENTURY SPORTS
DESC|Good. 1st. 13.25 x 8.25. a Monograph of 39pp, illustrated by
photograph and drawings, the endpapers have browned and the
exceedingly plain covers have surface tarnish but a bright
interior on superior paper. Walter E.Roth was Queensland's
Northern Protector of Aboriginals previously he was Demy of
Magdalen College, Oxford.
PRIC|35
UPDT|10/05/2004
UPTM|12:44:38 PM
BCAT|Sold
ABLE|1
UBID|1
STAT|Sold
PPRC|0
PDSC|QLD
BOOE|
BOOS|
BOOK|15
TRAN|A
ANAM|Paul De Nooijer
TNAM|Magie in De Vleeshal : De Fotografie Van Paul De Nooijer
PBLS|Middleburg: Deze Publikatie, 1987
SUB1|PAUL DE NOOJIER, NETHERLANDS PHOTOGRAPHER, DUTCH PHOTOGRAPHY ,
DRAMATIC VISUAL ART
DESC|Illustrated Card. Very Good. 1st. Softcover. 8.5 x 9.25. 50pp
with triple expanding heart 111 Kleurprints. A major art work by
an icon Dutch photgrapher, covers a little rubbed. In all my work
I have wanted to involve the framework in the representation so as
to suggest what is taking place behind it.
PRIC|25
UPDT|8/05/2004
UPTM|1:36:35 PM
BCAT|Art
ABLE|1
UBID|3
STAT|For Sale
PPRC|0
PDSC|art
BOOE|
BOOS|
BOOK|18
TRAN|A
ANAM|A H Archibald Henry Rea, Illustrated by Max Cowper
TNAM|LINDORES ABBEY and It's Historic Associations
PBLS|Dundee: James P. Mathew, 1902
SUB1|LINDORES ABBEY, ECCLESIASTICAL ARCHITECTURE, SCOTTISH PILES
MAX COWPER
DESC|Illustrated Boards. Good. 1st. Travel and Historic Guide. 

Ok Java gurus can this be done

2004-05-30 Thread Andrew Scott
Ok,

 
On the weekend I was looking at creating a variable back to CF, I am aware
that you can create structures and normal string variables as well as
queries...

 
But is there a way you can create a variable that can contain an array?

 
I can see potential for it but couldn't find a way to do this...

 
Anyone done it or maybe know how to do it..

Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485-Fax: 03 9699 7976
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Application Security Confusion

2004-05-30 Thread Jeff Chastain
Ok, I must really be missing something obvious, because this makes no sense.

 
I have an application that has security setup and tracked via session
variables.The cfapplication tag has the setClientCookies attribute set to
true, and the sessionTimeout attribute has a createTimeSpan value of
0,0,15,0 which I thought was 15 minutes (I am questioning most everything I
knew now).At the beginning of each secure page, there is an isDefined
check to see if a session structure userAuth exists.If so, then further
checks are done to check for valid permissions - if not, the user is sent to
the login screen.

 
When I first load the application, I get sent to the login screen as
expected.However, if I leave my browser window open with no activity for
30 minutes, I find I can still navigate the secure pages without having to
log in again.What is even weirder is that I can close all of my browser
windows, load a new browser window and go directly to a secure url in the
site without having to log in again.

 
I am beginning to question everything I knew about session variables, but I
thought they were supposed to time out and die automatically based upon the
sessionTimeout attribute of the cfapplication tag and they always died
immediately upon closing the browser.

 
My session variables won't die!

 
Thanks for any pointers.
-- Jeff
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Again Java CFX

2004-05-30 Thread Paul Vernon
Andrew,

 
I'm happy to see you seem to have solved your problem but I am a little
puzzled by your response...

 
My question was

 
 Have you registered CFX_nuImage.nuImageResize or CFX_nuImage in the admin
area?

 
Your response was

 
 Yes I have and I know I said that!

I can understand your respose to the question but I was really interested in
which one you had registered OR whether you had tried both. I was also
interested in how you were calling it in your cfm template mainly to raise
the question as to whether or not what you had in your code matched what you
had registered... 

 
Also I'd just like to point out that I specifically checked the thread to
see if you has stated any of this before and I couldn't find any reference
to what you had named the tag in the CF Admin area or indeed any example of
how you were calling it in your code All I saw was a whole heap of stuff
about jar files and directories... Sometimes the obvious can escape us all
and I figured the question needed to be asked.

 
Paul
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Again Java CFX

2004-05-30 Thread Andrew Scott
Paul,

 
Below is a one of the many posts I have made saying just that:-)

 
I bolded the text that you claim you couldn't find!

 
==

 
Guy

I was talking about the java package...

If I have the class file in a directory called nuImage with the package name
nuImage it will not be called from coldfusion.

Now in coldfusion admin I have typed the following

cfx_nuImageResize as the name of the tag
as for the class file the name is this
nuImageResize

For the above to work, the class file can't be were I want it but in the
root of the jar file.

I have also tried this

cfx_nuImageResize
nuImage.nuImageResize

as well as

cfx_nuImageResize
nuImage/nuImageResize



Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485-Fax: 03 9699 7976

_

From: Paul Vernon [mailto:[EMAIL PROTECTED] 
Sent: Monday, 31 May 2004 11:15 AM
To: CF-Talk
Subject: RE: Again Java CFX

Andrew,

I'm happy to see you seem to have solved your problem but I am a little
puzzled by your response...

My question was

 Have you registered CFX_nuImage.nuImageResize or CFX_nuImage in the admin
area?

Your response was

 Yes I have and I know I said that!

I can understand your respose to the question but I was really interested in
which one you had registered OR whether you had tried both. I was also
interested in how you were calling it in your cfm template mainly to raise
the question as to whether or not what you had in your code matched what you
had registered... 

Also I'd just like to point out that I specifically checked the thread to
see if you has stated any of this before and I couldn't find any reference
to what you had named the tag in the CF Admin area or indeed any example of
how you were calling it in your code All I saw was a whole heap of stuff
about jar files and directories... Sometimes the obvious can escape us all
and I figured the question needed to be asked.

Paul 
_
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




[Reply To] Re: parsing help for a slow learner

2004-05-30 Thread Seamus Campbell
Hi Aaron and thanks

I tried your method (as I can understand lists better than regex
and I have different numbers of fields for each record) but got
the below error (I can't see why it doesn't like CFSET ValueList
= )
Any clues please
==
Invalid CFML construct found on line 9 at column 26.
ColdFusion was looking at the following text:
=

The CFML compiler was processing:

an _expression_ beginning with ValueList, on line 9, column
16.This message is usually caused by a problem in the expressions
structure.
a CFSET tag beginning on line 9, column 10.
a CFSET tag beginning on line 9, column 10.
a CFSET tag beginning on line 9, column 10.

 

The error occurred in
C:\Inetpub\wwwroot\Booksmith\update_records_list.cfm: line 9

 
7 : CFIF Meta EQ BOOS
8 :CFSET FieldList = 
9 :CFSET ValueList = 
10 : 		
11 : CFELSEIF Meta EQ BOOE
==

 You wrote 
Hi Seamus

You have a few people helping you already, but I thought I would
share how I would do this for a different perspective: basically,
I ask myself how would I do this manually, then map the process
to code. I guess it helps to be able to think like a computer, but
I digress.

An alternative to the dynamic SQL generation is provided using [
] instad of  .

Step 0: Get access to the file
CFFILE ACTION="" VARIABLE=inFile etc etc

Step 1: process each line
This step includes recognizing that each piece of information is
on a separate line (Chr(13)Chr(10)), and that on each line we
have the metadata (BOOS, ANAM, TNAM, etc), separated from the data
with a | character. NB: I treat things (everything!) as a list. I
don't/can't do regex in my head, I do lists.

[CFSET Record = StructNew()]

CFLOOP LIST=#inFile# DELIMITERS=#chr(10)# INDEX=aLine

Step 2: recognize records:
This step includes grabbing the metadata for subsequent use
Start = BOOS|
End = BOOE|

 CFSET Meta = ListFirst(aLine, |)

Just for fun (to handle a simple potential problem of missing
fields/data), we will dynamically create the insert SQL statement
as we go. To do this we will need 2 strings - the field list and
the value list. We may as well initialize them at the start of a
record. 

NB: to keep it simple, we are also going to treat all fields as
string. You can modify this process as you see fit.

 CFIF Meta EQ BOOS
CFSET FieldList = 
CFSET ValueList = 

[CFSET junk = StructClear(Record)]

If it's the end of the record, we should insert it into the
database...

 CFELSEIF Meta EQ BOOE
CFQUERY DATASOURCE=etc etc
INSERT INTO Books (#FieldLIst#) VALUES
(#ValueLIst#)
/CFQUERY

[Do your data insert here, using the key/value data from
the Record struct]


Step 3: recognize fields
We have tested for start and end of record, everything else is
assumed to be a field: build up the field and value lists
accordingly...

 CFELSE
CFSET FieldData = Trim(ListRest(aLine, |))
CFSET FieldList = ListAppend(FieldList, Meta)
CFSET ValueList = ListAppend(ValueList,
'#FieldData#')

[CFSET junk = StructInsert(Record, Meta, FieldData)]
 /CFIF

/CFLOOP

That will pretty much do want you want.

HTH 
Aaron

- Original Message - 
From: Seamus Campbell 
To: CF-Talk 
Sent: Monday, May 31, 2004 1:46 AM
Subject: parsing help for a slow learner


Hi

I'm hoping some-one can help me.
I have to parse a file to insert data into a database, and I'm

stuck on the initial parsing. (I have some sort of mental block

when it comes to this sort of stuff)

A sample of the file is at the bottom of this email.

each record is starts with BOOS| and ends with BOOE|

At the moment I am reading the file, then replacing the BOOS|
with a ~ and looping thru the file using the new delimiter (~)
This way I can get each record but I can't seem to then get each

field.

I have tried:

CFFILE file=#myFile# action="" variable=myData
cfset myDelim = BOOS|
cfset myData = Replace(myData,myDelim,~,ALL)

cfloop index=myLine list=#myData# delimiters=~

cfloop index=myRecord list=#myLine#
delimiters=#Chr(10)##Chr(13)#

cfset Field = left(Trim(myLine),4)
cfset Data = "" |)) 
!--- Input data here ---

/cfloop
hr

/cfloop

But this seems to get BOOK and then the rest of the record ie
doesn't see a new line

Any help at all would be greatly appreciated 

Seamus


BOOS|
BOOK|04
TRAN|D
ANAM|ROTH, WALTER E.
TNAM|NORTH QUEENSLAND ETHNOGRAPHY Bulletin No.4 : GAMES, SPORTS
AND
AMUSEMENTS
PBLS|Home Secretary's Department Brisbane, 1902
SUB1|ABORIGINAL CULTURE, AUSTRALIA HISTORY, NATIVE MONOGRAPHS,
19TH
CENTURY SPORTS
DESC|Good. 1st. 13.25 x 8.25. a Monograph of 39pp, illustrated by

 
photograph and drawings, the endpapers have browned and the
exceedingly plain covers have surface tarnish but a bright
interior on superior paper. Walter E.Roth was Queensland's
Northern Protector of Aboriginals previously he was Demy of

Magdalen College, Oxford.
PRIC|35
UPDT|10/05/2004
UPTM|12:44:38 PM
BCAT|Sold
ABLE|1
UBID|1

RE: the ever popular cflock best practice revisited

2004-05-30 Thread Matt Robertson
Don wrote:
I was given one very useful URL on cflock for preCFMX and a link to
CFMX
http://www.macromedia.com/support/coldfusion/ts/documents/tn17882.htm#5

Yes, those both should tell you everything you need about cflock in both
pre- and post-MX environments.

This is a nice supplement for the pre-MX era:

http://depressedpress.com/DepressedPress/Content/ColdFusion/Guides/Index
.cfm

And has a good, fairly recent discussion on variables as well.


 Matt Robertson [EMAIL PROTECTED] 
 MSB Designs, Inc.http://mysecretbase.com

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: [Reply To] RE: parsing help for a slow learner

2004-05-30 Thread Ben Forta
Seamus,

 
This is a little trickier now. The simple solution would be to treat it as a
list delimited by line breaks, but it is not as you have some fields that
contains breaks in it, and no safe end field markers, so this needs to be
a bit manual (as in loop line by line and see if it is a new field or not).

 
So, you loop through record by record (what you already have), and then line
by line within each record constructing the fields, and then doing something
with them. It may be best to turn the data into a query, so for each record
you add a row, and then for each field you set a cell.

 
Here is code that shows this:

 
!--- Get all records ---
CFSET records=REFindAll((BOOS\|).*?(BOOE\|), myData)

 
!--- Create a query ---
CFSET
myQuery=QueryNew(BOOS,BOOK,TRAN,ANAM,TNAM,PBLS,SUB1,DESC,PRIC,UPDT,UPTM,BCA
T,ABLE,UBID,STAT,PPRC,PDSC,BOOE)

 
!--- Loop through them ---
CFLOOP INDEX=i FROM=1 TO=#ArrayLen(records.pos)#

 !--- Add a row to the query ---
 CFSET QueryAddRow(myQuery)

 !--- Loop through records ---
 CFSET record=Mid(myData, records.pos[i], records.len[i])
!--- Initialize field ---
CFSET field=
!--- Loop through lines in this record ---
CFLOOP INDEX=line LIST=#record# DELIMITERS=#Chr(10)##Chr(13)#
!--- If has a | in it, then treat it as start of new field ---
CFIF line CONTAINS |
!--- New field, save to field --- 
CFSET field=line
CFELSE
!--- Next line of field, append to field --- 
CFSET field=fieldline
/CFIF
!--- Now that we have the field, split it, before | is name, after is
value ---
CFSET field_name=ListFirst(field, |)
CFSET field_value=ListRest(field, |)
!--- And save it to the query ---
CFSET QuerySetCell(myQuery, field_name, field_value)
 /CFLOOP
/CFLOOP

 
Use this with the function I gave you earlier. You'll then end up with a
query named myQuery (change the name to something more descriptive). The
query will have the fields in your record (same names), and can be used like
any other ColdFusion query. To display it you could do this:

!--- Show query contents ---
CFDUMP VAR=#myQuery#

 
The next step would be to turn this all into a function, pass it a file (or
file contents) and get back a query.

 
And you should be all set.

 
--- Ben

 
PS Thanks for asking, little challenges like this are good practice. :-)

_

From: Seamus Campbell [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 30, 2004 6:20 PM
To: CF-Talk
Subject: [Reply To] RE: parsing help for a slow learner

Thanks Ben. That's a wonderful piece of code (most of which I'm
still trying to understand!)
I feel really stupid now but I'm still stuck.
I added your code and can now get the below.

I can't see how to get each field out of each record to input
into the database. I can see each record is a list with delimiters
of BOOK|, TRAN| ANAM| etc but I can't see how to use these
delimiters to get each field (does that make sense?)

Any help or clues would be great.


BOOS| BOOK|04 TRAN|D ANAM|ROTH, WALTER E. TNAM|NORTH QUEENSLAND
ETHNOGRAPHY Bulletin No.4 : GAMES, SPORTS AND AMUSEMENTS PBLS|Home
Secretary's Department Brisbane, 1902 SUB1|ABORIGINAL CULTURE,
AUSTRALIA HISTORY, NATIVE MONOGRAPHS, 19TH CENTURY SPORTS
DESC|Good. 1st. 13.25 x 8.25. a Monograph of 39pp, illustrated by
photograph and drawings, the endpapers have browned and the
exceedingly plain covers have surface tarnish but a bright
interior on superior paper. Walter E.Roth was Queensland's
Northern Protector of Aboriginals previously he was Demy of
Magdalen College, Oxford. PRIC|35 UPDT|10/05/2004 UPTM|12:44:38
PM BCAT|Sold ABLE|1 UBID|1 STAT|Sold PPRC|0 PDSC|QLD BOOE| 
_
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




command line copy... ?

2004-05-30 Thread Gonzo Rock
Sorry... I figured it out... it was a batch file I created via dir *.html 
/b dirlist.bat and then edited it quickly with a bunch of copy master.file 
to blah...

:-(

--

Running in a DOS window...

I have done this in the past... many times actually, but can't seem to 
stumble onto the proper syntax again.

I want to copy the contents of one file and overwrite the contents of all 
the other files in the directory with it.Now all the files will be 
identical except for their different names.

[c:\copy master.html*.html ] ...or some other syntax has worked in the 
past... many times actually... today... brain fart!
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Rookie Regex question

2004-05-30 Thread Matt Robertson
I want to be able to plug in a dynamic regex, like you see below.Its
part of a thing that lets someone specify regex-based form field
validation.

Thing is, the code below passes and I want it to fail.I'm sure the
problem is my rudimentary regex skills.I'm doing something stoopid
here, but I can't find it.

If I wanted the string below to accept only uppercase chars, A to Z,
what would I change here?

cfset variables.ThisRegex=[A-Z]
cfset form.FieldValue=HOLTSVILLEblah
cfif REFind(#variables.ThisRegex#,form.FieldValue)
passedcfelsefailed/cfif
cfset test=REFind(#variables.ThisRegex#,form.FieldValue)
cfdump var=#variables#


 Matt Robertson [EMAIL PROTECTED] 
 MSB Designs, Inc.http://mysecretbase.com

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




http_referer

2004-05-30 Thread Parker, Kevin
Having a little trouble getting the syntax right for checking that a certain page was called from a certain page - can anyone advise please. Can you test that http_referer contains certain information rather than testing the whole string.

TIA!!!

+++
Kevin Parker
Web Services Manager
WorkCover Corporation

p: 08 8233 2548
e: [EMAIL PROTECTED]
w: www.workcover.com
+++


This e-mail is intended for the use of the addressee only. It may 
contain information that is protected by legislated confidentiality
and/or is legally privileged. If you are not the intended recipient you
are prohibited from disseminating, distributing or copying this e-mail.

Any opinion expressed in this e-mail may not necessarily be that of the
WorkCover Corporation of South Australia. Although precautions have
been taken, the sender cannot warrant that this e-mail or any files
transmitted with it are free of viruses or any other defect.

If you have received this e-mail in error, please notify the sender
immediately by return e-mail and destroy the original e-mail and any
copies.

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Rookie Regex question

2004-05-30 Thread Matthew Walker
You are matching part of the string when you really want to match the whole
string. Try cfset variables.ThisRegex=^[A-Z]$

Matthew


From: Matt Robertson [mailto:[EMAIL PROTECTED] 
Sent: Monday, 31 May 2004 2:18 p.m.
To: CF-Talk
Subject: Rookie Regex question

I want to be able to plug in a dynamic regex, like you see below.  Its
part of a thing that lets someone specify regex-based form field
validation.

Thing is, the code below passes and I want it to fail.  I'm sure the
problem is my rudimentary regex skills.  I'm doing something stoopid
here, but I can't find it.

If I wanted the string below to accept only uppercase chars, A to Z,
what would I change here?  

cfset variables.ThisRegex=[A-Z]
cfset form.FieldValue=HOLTSVILLEblah
cfif REFind(#variables.ThisRegex#,form.FieldValue)
passedcfelsefailed/cfif
cfset test=REFind(#variables.ThisRegex#,form.FieldValue)
cfdump var=#variables#


Matt Robertson   [EMAIL PROTECTED] 
MSB Designs, Inc.  http://mysecretbase.com


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: http_referer

2004-05-30 Thread Matthew Walker
FindNoCase(substring, cgi.http_referer)

But bear in mind some browsers or client internet security tools might hide
the http_referer value. I think Norton Internet Security does.

Matthew

_

From: Parker, Kevin [mailto:[EMAIL PROTECTED] 
Sent: Monday, 31 May 2004 2:25 p.m.
To: CF-Talk
Subject: http_referer

Having a little trouble getting the syntax right for checking that a certain
page was called from a certain page - can anyone advise please. Can you test
that http_referer contains certain information rather than testing the whole
string.

TIA!!!

+++
Kevin Parker
Web Services Manager
WorkCover Corporation

p: 08 8233 2548
e: [EMAIL PROTECTED]
w: www.workcover.com
+++


This e-mail is intended for the use of the addressee only. It may 
contain information that is protected by legislated confidentiality
and/or is legally privileged. If you are not the intended recipient you
are prohibited from disseminating, distributing or copying this e-mail.

Any opinion expressed in this e-mail may not necessarily be that of the
WorkCover Corporation of South Australia. Although precautions have
been taken, the sender cannot warrant that this e-mail or any files
transmitted with it are free of viruses or any other defect.

If you have received this e-mail in error, please notify the sender
immediately by return e-mail and destroy the original e-mail and any
copies.


_
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: CFC Document Root Element is Missing Error

2004-05-30 Thread Matthew Walker
I'd guess it's a whitespace problem. Is there leading whitespace in your
generated XML? Try adding cfcontent type=application/xml reset=yes
just before your output your xml.

Matthew



_

From: Les Mizzell [mailto:[EMAIL PROTECTED] 
Sent: Sunday, 30 May 2004 2:24 p.m.
To: CF-Talk
Subject: CFC Document Root Element is Missing Error

Evening,

I'm using a modified CFC originally from the Macromedia site to grab a 
RSS News Feed. The .cfc file is in the same folder as the doc calling 
the CFC.

It works perfectlly on my local machine. However, when I put it out on 
the server, I get a Document Root Element is Missing error message.

Anybody got any ideas?I have access to the CF Admin. on the server in 
question.

Thanks

CODE BELOW:

*On the Page outputting the feed:*

cfinvoke component=GetNewsFeed method=getheadlines 
returnVariable=newsfeed url="" 
type=rss

!---Queries and Output Statements on down the page ---

*GETNEWSFEED.cfc**
cfcomponent 
cffunction name=GetHeadlines access=public output=True

cfargument name=url type=string required=true/
cfargument name=type type=string required=true/

cfhttp url="">
cfscript
try {
 switch(trim(lcase(arguments.type))) {
case 'rdf':
selectedElements = XmlSearch(xmlparse(cfhttp.filecontent), 
/rdf:RDF/:item);
break;
case 'rss':
selectedElements = XmlSearch(xmlparse(cfhttp.filecontent), 
/rss/channel/item);
break;
default:
return false;
break;
 }
 articles = QueryNew(title, link, description);
 for(index = 1;index lt ArrayLen(selectedElements);index = index + 
1) {
QueryAddRow(articles);

QuerySetCell(articles,title,selectedElements[index].title.XmlText);
QuerySetCell(articles,link,selectedElements[index].link.XmlText);

QuerySetCell(articles,description,selectedElements[index].description.XmlT
ext);
 }
} catch(Any excpt) {
 return excpt.Message;
}
/cfscript

cfreturn articles/

/cffunction
/cfcomponent

-- 
Les Mizzell
---
Do geeks die when exposed to sunlight?
---

_
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Confused about calling a function within a CFC

2004-05-30 Thread Jim Davis
Ray already answered the question, but I thought I'd share my thinking on
this as well.

I've had many arguments about this view, but I find it helps tremendously to
view CFCs as persistable CF templates.The more accepted view is to view
them as objects, and this can be useful, but only if you already know
objects or are attempting to replicate an object-based pattern or
architecture.

Looking at CFCs as CF templates is, I think, probably closer to the truth of
how they were designed.For me it also clears up some of the conceptual
holes when you try to determine why the designers did certain things.

For example:

1) In any CF template the variables scope is only viewable by that
template - that's why it makes sense to me that the variables scope equates
to the private scope for CFCs.

2) As Raymond said, the way you call a CFC method is exactly equivalent to
way you would call any function in any CFC template. They really are the
same - the terminology is different, but don't let that confuse you - if you
know how to use functions in any CF page then you know how to use methods in
CFCs. 

3) In CFCs, just like in any CF template, processing occurs from top to
bottom.Any code outside of functions is run immediately.When I think
about it like this the pseudo-constructor (and lack of a real constructor)
makes much more sense: it's just like any template - what's there runs like
it would in any template.

4) Many common CFC questions can be answered easily when you start thinking
like this as well.CFCs use and access most scopes (CGI, Application,
Server, Session, Cookie, etc) the same way as any template.Although there
are larger considerations to using them CFCs use shared scopes, custom tags
and CFINCLUDEs the same way as any templates.For example in a normal CF
template you can CFINCLUDE a page of functions - those functions are then
local to the template.In a CFC you can CFINCLUDE a page of functions -
those functions are then methods of the CFC.

The big difference between normal CF templates and CFCs is that CFCs are
persistable - in other words they can be run, but then stored in a shared
scope and reused.But even this can make more sense if you think about them
as templates: basically a normal template runs, then stops and it's assets
are destroyed.CFCs are run, then stowed instead of being destroyed - their
assets are still available indefinitely.

You can then access them via their method calls (functions) but you can
think of this as running a function on another CF page.

The metaphor breaks down some when you get into thinking about CFCs as
objects, but it still helps.There've been may arguments about how CFCs
aren't OO enough - and considered as objects they really aren't.However
considered as persistable CF templates with some object features it makes
(at least to me) much more sense.

CFCs just aren't objects - they are CF templates with some special
capabilities (and limitations) and they act much more like CF templates for
most purposes than like objects.

I'm not sure if this helps or confuses you more, but I find thinking this
way helps me immensely when conceptualizing how CFCs work.

Jim Davis
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: CFC Document Root Element is Missing Error

2004-05-30 Thread Les Mizzell
Matthew Walker wrote:

 I'd guess it's a whitespace problem. Is there leading whitespace in your
 generated XML? Try adding cfcontent type=application/xml reset=yes
 just before your output your xml.

Exactly where does that need to go, plus if that's it why would it work 
on my local server, but error on another?

It isn't some type of mapping problem?

The current page is trying to display this and nothing else:

cfif IsQuery(Newsfeed)
cfoutput query=newsfeed
 lia href="">
/cfoutput
/cfif

Thanks

-- 
Les Mizzell
---
Do geeks die when exposed to sunlight?
---
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: CFC Document Root Element is Missing Error

2004-05-30 Thread Matthew Walker
OK I see you're not actually generating the XML. Ignore the comment about
cfcontent then.

Still, it's an XML parsing error that often seems to be caused by
whitespace. You could try cfdumping cfhttp immediately after the cfhttp tag:

cfdump var=#cfhttp#

_

From: Les Mizzell [mailto:[EMAIL PROTECTED] 
Sent: Monday, 31 May 2004 4:26 p.m.
To: CF-Talk
Subject: Re: CFC Document Root Element is Missing Error

Matthew Walker wrote:

 I'd guess it's a whitespace problem. Is there leading whitespace in your
 generated XML? Try adding cfcontent type=application/xml reset=yes
 just before your output your xml.

Exactly where does that need to go, plus if that's it why would it work 
on my local server, but error on another?

It isn't some type of mapping problem?

The current page is trying to display this and nothing else:

cfif IsQuery(Newsfeed)
cfoutput query=newsfeed
 lia href="">
/cfoutput
/cfif

Thanks

-- 
Les Mizzell
---
Do geeks die when exposed to sunlight?
---

_
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: CFC Document Root Element is Missing Error

2004-05-30 Thread Les Mizzell
 cfdump var=#cfhttp#

The dump looks correct on my local machine..

But, out on the server:

struct
Charset 	[empty string]
ErrorDetail 	Connect Exception: Connection timed out: connect
Filecontent 	Connection Failure
Header 	[undefined struct element]
Mimetype 	Unable to determine MIME type of file.
Responseheader 	
struct [empty]
Statuscode 	Connection Failure. Status code unavailable.
Text 	YES

That help any? I'm completely clueless at the moment

-- 
Les Mizzell
---
Do geeks die when exposed to sunlight?
---
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: CFC Document Root Element is Missing Error

2004-05-30 Thread Matthew Walker
Well that's definitely your problem -- the cfhttp isn't working. It might be
worth testing out cfhttp on some other URLs. You could also try setting the
cfhttp timeout value.

_

From: Les Mizzell [mailto:[EMAIL PROTECTED] 
Sent: Monday, 31 May 2004 4:49 p.m.
To: CF-Talk
Subject: Re: CFC Document Root Element is Missing Error

 cfdump var=#cfhttp#

The dump looks correct on my local machine..

But, out on the server:

struct
Charset [empty string]
ErrorDetail Connect Exception: Connection timed out: connect
Filecontent Connection Failure
Header [undefined struct element]
Mimetype Unable to determine MIME type of file.
Responseheader 
struct [empty]
Statuscode Connection Failure. Status code unavailable.
Text YES

That help any? I'm completely clueless at the moment

-- 
Les Mizzell
---
Do geeks die when exposed to sunlight?
---

_
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: CFC Document Root Element is Missing Error

2004-05-30 Thread Les Mizzell
 Charset [empty string]
 ErrorDetail Connect Exception: Connection timed out: connect
 Filecontent Connection Failure
 Header [undefined struct element]
 Mimetype Unable to determine MIME type of file.
 Responseheader
 struct [empty]
 Statuscode Connection Failure. Status code unavailable.
 Text YES

Ya know - although I have access to the server, it's on the other side 
of a firewall, and the IT guys that set it up along with the company 
network, are security paranoid (lawyers office). You wouldn't believe 
the nightmare of hoops I gotta jump through just to access SQL Server 
that the site is going to be running off of.

$10 says this is firewall/security related, and I know almost nothing 
about Windoz and Firewall security. Looks like a phone call to the IT 
guys is in order when they show back up on Tuesday...

-- 
Les Mizzell
---
Do geeks die when exposed to sunlight?
---
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]