Solved

Can you save CF code in an Access database?

Posted on 2006-07-05
14
120 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:firstbankak
Comment Utility
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
Comment Utility
Out of curiosity - which part didnt work?
0
 
LVL 13

Expert Comment

by:usachrisk1983
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 24

Expert Comment

by:dgrafx
Comment Utility
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
Comment Utility
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
Comment Utility
Believe my code & usachrisk1983's code are virtually the same - and would both solve the question.
0
 
LVL 13

Expert Comment

by:usachrisk1983
Comment Utility
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 24

Expert Comment

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

Author Comment

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

Thank you!
0
 
LVL 24

Accepted Solution

by:
dgrafx earned 500 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now