473,382 Members | 1,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Pass through query

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 sertain 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 MYFILED = TRUE"
What do I need to do to make this a pass through query?
Any help appreciated.
Alex
Jul 23 '05 #1
3 7253
On Sun, 23 Jan 2005 13:34:28 +0000, 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 sertain 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 MYFILED = TRUE"
What do I need to do to make this a pass through query?
Any help appreciated.


You create a passthrough query in Access by declaring it as such. From
the query designer, you right click and select
[SQL_Specific]_[Passthrough] from the sub menu. This will put you right
into the SQL text window. Here you want to right click on the title bar
and set your ODBC connection string. Set [Returns Records]=TRUE for
SELECT queries.

The thing to know about Passthrough queries is that you are bypassing the
Microsoft Jet interpreter and passing your query directly to MySQL. This
means that you will need to use strict MySQL syntax. While similar,
MySQL SQL syntax is not quite the same as Microsoft's.

In particular, MySQL has no true boolean type that understands
(TRUE,FALSE) which means your statement "WHERE MYFILEID = TRUE" would fail
in a passthrough query.

I might suggest -

If you are just starting with MySQL, you could just link the MySQL table
using the linked table manage you can invoke by right clicking in the
Tables panel. Once you create your linked table, you can create
ordinary Access queries that work against your MySQL table. The ODBC
driver will handle syntax translation for you.

When you understand MySQL a bit better, you will then be able to use
passthrough queries to your advantage.

Thomas Bartkus


The
thing to remember when using passthrough queries

Jul 23 '05 #2
I use the code
Set qrydef = CurrentDb.CreateQueryDef(myQueryName, myQueryDef)
and myQueyDef is something like
"SELECT * FROM MYTABLE WHERE MYFIELD = somevalue"
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

"Thomas Bartkus" <th***********@comcast.net> wrote in message
news:pa****************************@comcast.net...
On Sun, 23 Jan 2005 13:34:28 +0000, 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 sertain 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 MYFILED = TRUE"
What do I need to do to make this a pass through query?
Any help appreciated.


You create a passthrough query in Access by declaring it as such. From
the query designer, you right click and select
[SQL_Specific]_[Passthrough] from the sub menu. This will put you right
into the SQL text window. Here you want to right click on the title bar
and set your ODBC connection string. Set [Returns Records]=TRUE for
SELECT queries.

The thing to know about Passthrough queries is that you are bypassing the
Microsoft Jet interpreter and passing your query directly to MySQL. This
means that you will need to use strict MySQL syntax. While similar,
MySQL SQL syntax is not quite the same as Microsoft's.

In particular, MySQL has no true boolean type that understands
(TRUE,FALSE) which means your statement "WHERE MYFILEID = TRUE" would fail
in a passthrough query.

I might suggest -

If you are just starting with MySQL, you could just link the MySQL table
using the linked table manage you can invoke by right clicking in the
Tables panel. Once you create your linked table, you can create
ordinary Access queries that work against your MySQL table. The ODBC
driver will handle syntax translation for you.

When you understand MySQL a bit better, you will then be able to use
passthrough queries to your advantage.

Thomas Bartkus


The
thing to remember when using passthrough queries

Jul 23 '05 #3
Paradigm wrote:
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.


I'm not a MS Access user, so I can't speak from experience.
Does this web page help?
http://support.microsoft.com/?kbid=303968

I also found a topic in the MS Access Help titled "Send commands to an
SQL database using a pass-through query". Try searching the Help for
"pass through".

Regards,
Bill K.
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Tcs | last post by:
I've been stumped on this for quite a while. I don't know if it's so simple that I just can't see it, or it's really possible. (Obviously, I HOPE it IS possible.) I'm trying to get my queries...
2
by: Robert | last post by:
when using the following function to create a pass through query is there a way to set the query property, "Returns Rows" to no. The default is yes. Since we are planning to create the pass...
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
3
by: Zlatko Matić | last post by:
Hello. I'm wondernig what is happennig whith saved pass-through queries nested in regular JET query if regular JET query just filtrates result by start/end date...Does pass-through query first...
0
by: Zlatko Matić | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems...
3
by: ILCSP | last post by:
Hello, I'm fairly new to the concept of running action pass through queries (insert, update, etc.) from Access 2000. I have a SQL Server 2000 database and I'm using a Access 2K database as my...
1
by: Greg Strong | last post by:
Hello All, Why would brackets be added to the SQL of a pass through query to Oracle? If I paste the debug print of the SQL statement into SQLPlus of Oracle's XE edition it works, and does NOT...
2
by: Bob Alston | last post by:
If you have an access form with record source being a straightforward query and where clause in the form definition, will the query be sent to the back end jet/Access database and executed there,...
13
by: magickarle | last post by:
Hi, I got a pass-through query (that takes about 15 mins to process) I would like to integrate variables to it. IE: something simple: Select EmplID from empl_Lst where empl_lst.timestamp between...
9
by: JRough | last post by:
I tried to pass the $result from a mysql_query in a url like this line Header("Location:clm_historyXL.php?_result=".$result); but on the redirect location clm_history.php page I get an error on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.