Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can you save CF code in an Access database?

Posted on 2006-07-05
14
Medium Priority
?
135 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
13 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
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

 

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 2000 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
What You Need to Know when Searching for a Webhost Provider
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

782 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