By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,296 Members | 1,723 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,296 IT Pros & Developers. It's quick & easy.

Creating a pass through query

P: n/a
I want to create a pass through query in Access to get data from a MYSQL
table. I need to do this using code so that certain aspects of the query can
be changed.
When I look at the SQL version of a Select and a Passthrough query in access
they appear to be the same.
eg.
"SELECT * FROM MYTABLE WHERE MYFIELD = TRUE"
What do I need to do to make this a pass through query?
Any help appreciated.
Alex
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Paradigm wrote:
I want to create a pass through query in Access to get data from a MYSQL
table. I need to do this using code so that certain aspects of the query can
be changed.
When I look at the SQL version of a Select and a Passthrough query in access
they appear to be the same.
eg.
"SELECT * FROM MYTABLE WHERE MYFIELD = TRUE"
What do I need to do to make this a pass through query?
Any help appreciated.
Alex

It's a property of the QueryDef object. It will require a connect string.

--
This sig left intentionally blank
Nov 13 '05 #2

P: n/a
I use the code
Set qrydef = CurrentDb.CreateQueryDef(myQueryName, myQueryDef)
and myQueyDef is something like
"SELECT * FROM MYTABLE WHERE MYFIELD = TRUE"
This creates a query in Access but it is a select query. What do I need to
do to make it a pass through query.
Alex

"Trevor Best" <no****@besty.org.uk> wrote in message
news:41***********************@news.zen.co.uk...
Paradigm wrote:
I want to create a pass through query in Access to get data from a MYSQL
table. I need to do this using code so that certain aspects of the query can be changed.
When I look at the SQL version of a Select and a Passthrough query in access they appear to be the same.
eg.
"SELECT * FROM MYTABLE WHERE MYFIELD = TRUE"
What do I need to do to make this a pass through query?
Any help appreciated.
Alex

It's a property of the QueryDef object. It will require a connect string.

--
This sig left intentionally blank

Nov 13 '05 #3

P: n/a
As Trevor already stated, you need to set the query's Connect property

qryDef.Connect = "whatever's appropriate for MySQL"

Take a look at the various possibilities Carl Prothman lists in the ODBC
section of
http://www.able-consulting.com/ado_conn.htm

Put ODBC; in front of them to use them as Connect properties in Access.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Paradigm" <al********@hotmail.com> wrote in message
news:BV****************@newsfe5-win.ntli.net...
I use the code
Set qrydef = CurrentDb.CreateQueryDef(myQueryName, myQueryDef)
and myQueyDef is something like
"SELECT * FROM MYTABLE WHERE MYFIELD = TRUE"
This creates a query in Access but it is a select query. What do I need to
do to make it a pass through query.
Alex

"Trevor Best" <no****@besty.org.uk> wrote in message
news:41***********************@news.zen.co.uk...
Paradigm wrote:
> I want to create a pass through query in Access to get data from a
> MYSQL
> table. I need to do this using code so that certain aspects of the
> query can > be changed.
> When I look at the SQL version of a Select and a Passthrough query in access > they appear to be the same.
> eg.
> "SELECT * FROM MYTABLE WHERE MYFIELD = TRUE"
> What do I need to do to make this a pass through query?
> Any help appreciated.
> Alex

It's a property of the QueryDef object. It will require a connect string.

--
This sig left intentionally blank


Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.