Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Pass-Through Querries secretly.....shhhhhhh 1

Status
Not open for further replies.

scotttom

IS-IT--Management
Mar 5, 2002
143
US
I use pass through queries to hit stored procedures on a SQL server. I recreate them with this function I found here and it works great...

Code:
Public Sub fncMakeQDef(QDefName As String, SQLstring As String)
'*****************************­******************************­****
' Replaces an already existing query definition with a new one '
'*****************************­******************************­****
Dim db As Database
Dim qd As QueryDef

DoCmd.DeleteObject acQuery, QDefName

Set db = CurrentDb()
Set qd = db.CreateQueryDef(QDefName)

qd.Connect = "ODBC;DSN=MINE;UID=XXXXX;PWD=XXXXX;DATABASE=MINE"
qd.ReturnsRecords = True


qd.sql = SQLstring

qd.Close
db.Close


End Sub

But I wan to create it as a hidden pass-through query.

How do I do that?

Thanks in advance for any help.

Scott
 
Code:
Public Sub fncMakeQDef(QDefName As String, SQLstring As String)
'*****************************­******************************­****
' Replaces an already existing query definition with a new one '
'*****************************­******************************­****
Dim db As Database
Dim qd As QueryDef
Set db = CurrentDb()
set qd=db.querydefs(QDefName)
qd.sql = SQLstring
db.Close

SetHiddenAttribute acquery,QDefName ,True
End Sub
[\code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top