all groups > sql server connect > june 2006 >
You're in the

sql server connect

group:

How can I create a passthrough query from a VBA code?


How can I create a passthrough query from a VBA code? asteroid
6/28/2006 5:37:09 AM
sql server connect:
Hi!

I am trying to migrate the Back end of an MS Access based aplication to
an SQL server 2000. I KNOW how to use passthrough queries in MS Access.
So, my question is: How can I CREATE a passthrough query from a VBA
code?
I want to know WHERE to point that this will be a passthrough query? I
need something like this:

dim strSQL as string
strSQL = "SELECT * FROM Table1 LEFT JOIN Table1 ON ...... WHERE..."
' how do I point that this should be a passthrough query?
' Note that I don't want just to open a connection to the server,
because this
' will mean just to link the source tables
Me.Form.Recordsource = strSQL

Can you help me to deal with this?

Thanks!
A.
Sorry, it is "TABLE2" asteroid
6/28/2006 5:53:05 AM

strSQL = "SELECT * FROM Table1 LEFT JOIN Table2 ON ...... WHERE..."
Re: How can I create a passthrough query from a VBA code? Arnie Rowland
6/28/2006 8:10:08 AM
As I recall, if you are creating passthrough QueryDefs in Access, you denote
the SQL Server and database in the QueryDef. After you create a 'Linked
Table' in Access, it 'looks' like an Access table and the alterations to the
query are managed 'behind the scene'.

You may be able to get a more complete answer in one of the Access
newsgroups.

--
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."

*Yet Another Certification Exam


[quoted text, click to view]

AddThis Social Bookmark Button