>----- Original Message -----
>From: Britney Spears
>Dawgs,
>
>In my application.cfm file I'm doing two queries on the same database
>just different tables. Is there an easier way using, lets say, CFQUERY
>DBTYPE=?
>
><cfquery name="setdata" datasource="#request.dsn_prefs#">
>SELECT *
>FROM tableData
>WHERE strLogin = '#SESSION.user#'
></cfquery>
>
><cfset session....
><cfset session....
>
><cfquery name="setref" datasource="#request.dsn_prefs#">
>SELECT *
>FROM tableref
></cfquery>
>
><cfset session....
><cfset session....________________________________

  Try this.

<cfquery name="setdata" datasource="#request.dsn_prefs#">
SELECT *
FROM tableData
WHERE strLogin = '#SESSION.user#'
</cfquery>

<cfquery name="setref" datasource="#request.dsn_prefs#">
SELECT *
FROM otherDataBase..tableData
</cfquery>

As long as the username that you are logging in with to request.dsn_prefs
has access to the other DB this should work.
Notice the ".." between the database name and the table.

PS Just out of curiosity, why are you using Britney Spears as your email?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to