Solved

Can you save CF code in an Access database?

Posted on 2006-07-05
14
122 Views
Last Modified: 2013-12-24
I am working on a workaround but ideally I would like to do this:

I have a field in an Access database (have tried text and memo fields) and am trying to store CF variables such as

...mailto:#PE.Active#?cc=#PE.Backup#&Subject=Webmaster...

But the email opens with the variables literally as #PE.Active# instead of their values...



0
Comment
Question by:firstbankak
  • 4
  • 3
  • 3
  • +1
14 Comments
 
LVL 7

Expert Comment

by:bwasyliuk
ID: 17044443
I store variables, etc in my database (always need to be careful that they exist when doing the following, but it works):

I might have a value like this in a database field: "this is a string with a variable called 'test', its value is"&variable.test

This is of course a very contrived example, but you can take this value (lets say it is in Col1) and evaluate it:

<cfoutput>#evaluate(myquery.Col1)#</cfoutput>

Let me know if you need me to explain further.
0
 

Author Comment

by:firstbankak
ID: 17044516
Hmmmm...here's literally what I am trying to accomplish:

<cfoutput query='test'>
<a href='#mhLink#'>#mhName#</a>
</cfoutput>


where mhLink = "mailto:#PE.Active#?cc=#PE.Backup#&Subject=Webmaster"
0
 
LVL 7

Expert Comment

by:bwasyliuk
ID: 17044587
So, you could do:

<cfoutput query='test'>
<a href='#evaluate(mhLink)#'>#mhName#</a>
</cfoutput>

Of course, the #PE.Active# and #PE.Backup# variables have to exist prior to this evaluate step.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:firstbankak
ID: 17045009
You know, that didn't work, but thanks for helping out I'm just going to go another way with this...
0
 
LVL 7

Expert Comment

by:bwasyliuk
ID: 17045447
Out of curiosity - which part didnt work?
0
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17051365
You need to use quotes in the DB, so it should look like this:

'mailto:' & #PE.Active# & '?cc=' & #PE.Backup# & '&Subject=Webmaster'

Then you could use:

evaluate(yourQuery.yourColumn)
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 17051685
why not use a "flag"
real basic ex:
at time of insert or update db you put in the flag

for ex, you insert this text:
"mailto:^PEActive^?cc=^PEBackup^&Subject=Webmaster"

Then when you pull it out:
#replace(PE.yourdbfield,"^PEActive^",PE.Active,"all")#

I'm assuming your query name is "PE"

et cetera
0
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17132319
How did this work for you?  If it didn't work with the hash marks from my previous example, try removing them - - but this should work.
0
 
LVL 7

Expert Comment

by:bwasyliuk
ID: 17406674
Believe my code & usachrisk1983's code are virtually the same - and would both solve the question.
0
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17406869
I agree with bwasyliuk, and if the poster had any problems with them, I'm sure we'd both be happy to continue to try and debug the problems.
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 17407980
Hello guys
I do believe mine is the best solution.
Real simple and straight forward.
0
 

Author Comment

by:firstbankak
ID: 17407997
Please close this question.  The individual who initiated the question with me is no longer employed here.

Thank you!
0
 
LVL 25

Accepted Solution

by:
dgrafx earned 500 total points
ID: 17408029
Well that hardly seems fair to us, firstbankak.
We, sometimes, put a lot of work into these questions.
And even when question is fairly simply, like this one, the job was completed and our only pay is a few points.
Thank You
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question