# How do I return database record to flash from cfm page

**URL:** <https://forum.kirupa.com/t/how-do-i-return-database-record-to-flash-from-cfm-page/260769>\
**Category:** flash\
**Created:** [May 19, 2008, 6:46pm UTC](https://forum.kirupa.com/t/how-do-i-return-database-record-to-flash-from-cfm-page/260769 "2008-05-19T18:46:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dpots](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@Dpots](https://forum.kirupa.com/u/Dpots)\
**Post date:** [May 19, 2008, 6:46pm UTC](https://forum.kirupa.com/t/how-do-i-return-database-record-to-flash-from-cfm-page/260769/1 "2008-05-19T18:46:22Z")

</div>

I downloaded a flash login setup and have been trying to revise it to my specific needs.

I have the login function working in that when they enter a valid username and password, they are directed to the correct frame in flash.

What I want to do is for a specific field record from my Access database to be diplayed on that page. Let’s say, I have a field called “PetName”

Right now, the coldfusion setup is set to give a thumbs up or down as far as access. Here is the code:

\<cfsetting enablecfoutputonly=“Yes”\>

\<cfquery name=“ClientLogin” datasource=“DSN name setup here”\>  
SELECT \*  
FROM Clients  
WHERE Customer = ‘#form.usr#’  
AND Secret = ‘#form.pw#’  
\</cfquery\>

\<cfoutput\>  
\<cfif #ClientLogin.recordcount# is ‘1’\>  
&CFresponse1=ok&  
\<cfelseif #ClientLogin.recordcount# is ‘0’\>  
&CFresponse1=bad&  
\</cfif\>  
\</cfoutput\>

What would I need to add to this code for it to send the data from the field “PetName” along with the ok or bad response?

Also, from within flash, what code would I need to display that record? Something to this affect:

loadVariables(“f22clientlogin.cfm”, \_root.form);  
Name = \_root.form.PetName;

This flash is setup so that on the root level, various movieclips are loaded throughout the process, hence the root level references.

Thanks,  
Dave
