Highlighted

Can't get password string from DB in coldfusion 11 but it works well in coldfusion8

New Here ,
Aug 09, 2016

Copy link to clipboard

Copied

The below shown code works well on CF8. password can get from DB successfully. But it doesn't work on CF11. It can't retrive password from DB. Password is always empty. username and datasource can get from DB. The password stored in DB is displayed as:

0-8VB>D;.<MQ95X$(5M2$>P  

I guess maybe CF11 variable can't store complex/special string? How to save it? I need get password from DB and then decrypt it.

<cfquery datasource="#XXXX#" name="GetConfig">

SELECT S.A

,IsNull(ds.column_a, '') AS DataSource

,IsNull(un.column_a, '') AS Username

,IsNull(pw.column_a, '') AS Password

FROM (SELECT column_a AS A FROM table_a WHERE column_b='xxxx1') s

LEFT JOIN table_a ds ON ds.column_b='xxxx2'

LEFT JOIN table_a un ON un.column_b='xxxx3'

LEFT JOIN table_a pw ON pw.column_b='xxxx4'

</cfquery>

<cfset qDataSource = GetConfig.DataSource />

<cfset qUsername = GetConfig.Username />

<cfset qPassword = GetConfig.Password />

<cfoutput>

<p>datasource:#qDataSource#</p>

<p>username:#qUsername#</p>

<p>password:#qPassword#</p>

</cfoutput>

Views

333

Likes

Translate

Translate

Report

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

Can't get password string from DB in coldfusion 11 but it works well in coldfusion8

New Here ,
Aug 09, 2016

Copy link to clipboard

Copied

The below shown code works well on CF8. password can get from DB successfully. But it doesn't work on CF11. It can't retrive password from DB. Password is always empty. username and datasource can get from DB. The password stored in DB is displayed as:

0-8VB>D;.<MQ95X$(5M2$>P  

I guess maybe CF11 variable can't store complex/special string? How to save it? I need get password from DB and then decrypt it.

<cfquery datasource="#XXXX#" name="GetConfig">

SELECT S.A

,IsNull(ds.column_a, '') AS DataSource

,IsNull(un.column_a, '') AS Username

,IsNull(pw.column_a, '') AS Password

FROM (SELECT column_a AS A FROM table_a WHERE column_b='xxxx1') s

LEFT JOIN table_a ds ON ds.column_b='xxxx2'

LEFT JOIN table_a un ON un.column_b='xxxx3'

LEFT JOIN table_a pw ON pw.column_b='xxxx4'

</cfquery>

<cfset qDataSource = GetConfig.DataSource />

<cfset qUsername = GetConfig.Username />

<cfset qPassword = GetConfig.Password />

<cfoutput>

<p>datasource:#qDataSource#</p>

<p>username:#qUsername#</p>

<p>password:#qPassword#</p>

</cfoutput>

Views

334

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 09, 2016 0
Advocate ,
Aug 10, 2016

Copy link to clipboard

Copied

If you copy the text of that query and execute it in a query utility provided by the vendor of your database engine, does the query return a result?

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 10, 2016 1
New Here ,
Aug 10, 2016

Copy link to clipboard

Copied

Yes the query can return result successfully. I can see the password is 0-8VB>D;.<MQ95X$(5M2$>P  from return result. I defined a vairable qPassword and set value as returned password. But it show nothing when I use cfoutput to print it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 10, 2016 0
Advocate ,
Aug 11, 2016

Copy link to clipboard

Copied

Okay, if the query works exactly as portrayed in your post then immediately after the <cfquery> closing tag, add the statement <cfdump var="#GetConfig#"> and let us know what you see.

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 11, 2016 0