G
Guest
Hi,
Is there an ADO equivalent to changing the SQL of a QueryDef using DAO (see
DAO code example below)?
Thank you in advance for any help. In my research, I keep finding ADO code
references to forms and reports but not to tables and queries.
Larry
Sub SampleCode()
Dim dbs As Database
Dim qdf As QueryDef
Dim sOldSQL As String
Dim sNewSQL as String
Set dbs = CurrentDb
Set qdf = dbs.QueryDefs("qrySampleQuery")
sOldSQL = qdf.SQL
sNewSQL = "SELECT * from tblSampleTable"
qdf.SQL = sNewSQL
dbs.Close
Set qdf = Nothing
Set dbs = Nothing
End Sub
Is there an ADO equivalent to changing the SQL of a QueryDef using DAO (see
DAO code example below)?
Thank you in advance for any help. In my research, I keep finding ADO code
references to forms and reports but not to tables and queries.
Larry
Sub SampleCode()
Dim dbs As Database
Dim qdf As QueryDef
Dim sOldSQL As String
Dim sNewSQL as String
Set dbs = CurrentDb
Set qdf = dbs.QueryDefs("qrySampleQuery")
sOldSQL = qdf.SQL
sNewSQL = "SELECT * from tblSampleTable"
qdf.SQL = sNewSQL
dbs.Close
Set qdf = Nothing
Set dbs = Nothing
End Sub