Solved

Can you save CF code in an Access database?

Posted on 2006-07-05
14
126 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 

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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

623 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