Access ADO Help ( 4 Views )
-
Hello,
Does anyone know how to access the SQL of a stored query using ADO?
The DAO way to do it is:
Dim DB As DAO.Database
Dim strSQL As String
Set DB = CurrentDB
DB.QueryDefs("Some_Query").SQL = strSQL
DB.Close
What's the ADO equivalent of this?
Thanks!
(can, British Indian Ocean Territory)
I've never tried feeding in the name of a query, but this might work:
Code:
Set cn = Application.CurrentProject.Connection
Set cmd = New ADODB.Command
With cmd
.ActiveConnection = cn
.CommandText = "[Access Query Name Here]"
.Execute
End With
Set cmd = Nothing
Set cn = Nothing
(şenol, New Caledonia)
(ahmet, Zimbabwe)
Related Topics ... (or search in 1.720.883 topics !)
database access with ado (4) ado and access... argh!! (8) connect to access database using ado (6) bug in my login page, or ado, or access db (3) parameters to stored procedure using ado and ms access (3) connecting to a secured access database with ado and asp (4) limiting results from an access query through asp/ado/jet sql (6) ado 2.8? (14) much ado about nothing (7)
copyright © 2007-2031 Pfodere.COM ( 6 Pfoyihuee Online )
|