Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CF8 and ACCESS 2007 and cfoutput

Contributor ,
Mar 21, 2011 Mar 21, 2011

I installed the required ODBC driver for Access 2007 on CF8. Fine.

I declare a new DATASOURCE if CF (socket ODBC) fine

I write a CF file with a simple query (select) , the cfouput

Almost fine,

except that : the displayed data is encountered by the #  (like the called variable)

Here the code  :

<cfoutput>

<cfquery name="liste_ad" datasource="test_r4">
     select * from Descriptif_vehicules
</cfquery>

<cfloop query="liste_ad">
     #source_disponibilite#<br>
</cfloop>

</cfoutput>

here is the Display : (a single record in the base)

#http://www.avto.net/_AVTO/ad.asp?ID=4418041&show=1#

It has to be :

http://www.avto.net/_AVTO/ad.asp?ID=4418041&show=1

which is the data in the Access (.accdb file)  DB

How to get reed of the 2 x #    ???

Thanks for any help ?

Pierre.

TOPICS
Advanced techniques
826
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Mar 21, 2011 Mar 21, 2011

If you're asking how to display a hash character (#) inside a CFOUTPUT, just double it up - ie in your code put "##" - that'll display the symbol.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 21, 2011 Mar 21, 2011

No, I tried this, I retrieve the name of the field. not the data.

The problem, is that the value returned is surrounded by these 2 #.

Which nobody want.

This is only since I upgrade to Access 2007.

I will try on another field.

Thanks for contribution.

Pierre.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 21, 2011 Mar 21, 2011

What do you get if you CFDUMP liste_ad?

It looks to me liek those extra pound-signs are in your data.  If they shouldn't be there: get rid.  CF's just doing what it's been told to.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 21, 2011 Mar 21, 2011

You may be right, CFDUMP gives same result.

But I tried on other fields, and I do not have these problems.

May be, the # are not seen in the Access display table for that field.

May be there because it is an Internet adress, which means something to do for Access ?

I may need to look at Access 2007 fields formats/functions

Thanks again.

Pierre.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2011 Mar 21, 2011

If you're using the hyperlink data type for your field, I believe this is the default behavior. You could either rewrite the output using CF functions, or change the field data type to a regular character data type.

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Dave Watts, Eidolon LLC
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 21, 2011 Mar 21, 2011
LATEST

Good, I understand, I think that's why.

Many Thanks.

Pierre.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources