Create a pass-through query

J

JAnderson1070

I am trying to create a pass-through query to connect access to an oracle db.
I am unsure of how to do this other than change the query to pass-through.
Can anyone give me a generic example of this?

Thanks.
 
D

Douglas J Steele

Not quite sure what you're looking for. Create a query, open it in SQL view
without adding any tables, type the SQL, then change it to a pass-through so
that you can set the Connect property.

In VBA, you can do something like:

Dim qdfPassthrough As DAO.QueryDef
Dim strSQL As String

strSQL = "SELECT Time_Period_Nm " & _
"FROM TimePeriod_TimePeriodType_V " & _
"WHERE Time_Period_Type_Nm = 'Quarter' " & _
"ORDER BY Time_Period_Nm"
Set qdfPassthrough = CurrentDb().CreateQueryDef("", strSQL)
qdfPassthrough.Connect = ....

The Connect string you use can be for an ODBC DSN-less connection. See
http://www.carlprothman.net/Default.aspx?tabid=90 for sample strings.
 
Top