Highlighted

How to make odbc queries on db's on the same server, but registered to different domains?

New Here ,
Jan 02, 2016

Copy link to clipboard

Copied

I have two domains (A and B) hosted on the same server.  I need to query sql db's on one domain from the other domain.

I thought it should be as easy as this, but it's not finding the db.

From Domain A:

<CFQUERY datasource="datasource on domain B" DBSERVER="serverurl for domain B" username="username" password="!password">

SELECT

*

FROM table

</CFQUERY>

Thanks!

Views

172

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

How to make odbc queries on db's on the same server, but registered to different domains?

New Here ,
Jan 02, 2016

Copy link to clipboard

Copied

I have two domains (A and B) hosted on the same server.  I need to query sql db's on one domain from the other domain.

I thought it should be as easy as this, but it's not finding the db.

From Domain A:

<CFQUERY datasource="datasource on domain B" DBSERVER="serverurl for domain B" username="username" password="!password">

SELECT

*

FROM table

</CFQUERY>

Thanks!

Views

173

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
Jan 02, 2016 0
Engaged ,
Jan 02, 2016

Copy link to clipboard

Copied

If I am understanding you correction..   You have 2 domains each with their own databases and you want domain A to make calls to domain B's database? 

If that is the case you should have 2 datasources setup in CF.  All you would need to do is have domain A use domain B's datasource. 

Also, DBSERVER is a depreciated attribute and doesn't work anymore.

HTH,

--Dave

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...
Jan 02, 2016 0
BKBK LATEST
Adobe Community Professional ,
Jan 03, 2016

Copy link to clipboard

Copied

I am curious what your ColdFusion version is.

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...
Jan 03, 2016 0