Create a pass-through query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top