Hello,
I cannot figure out what's wrong with the syntax on the SQL statements. It's not a complicated process, is it?
All I want is to check out if the input dataset has been updated. So I can run my process if it has.
The query that I ran was in Excel ADO. But the dataset resides in MS Access. The variable TRANDATE is defined in Access as 'Number', not 'date'. I tried 'Dim TRNADATE as Integer', 'as Long', 'as date'. They all gave me error like 'ByRef ... Mismatch'. So I picked 'Variant'. But it gave me a diff error msg as shown in the subject. Maybe 'Variant' has nothing to do with the errors.
Let me know if you want the whole program.
Please advise.
Thanks.
Sub ExportAccessDBtoExcel(dsn As String, DTE As Long)
...
ConnCmd.CommandText = "SELECT TOP 50 * FROM " & dsn _
& "ORDER BY " & DTE & "DESC"
...
Sub tnt()
ExportAccessDBtoExcel "CO_PNC_CO_RPT_NBEXTRACT", TRANDATE
End Sub
I cannot figure out what's wrong with the syntax on the SQL statements. It's not a complicated process, is it?
All I want is to check out if the input dataset has been updated. So I can run my process if it has.
The query that I ran was in Excel ADO. But the dataset resides in MS Access. The variable TRANDATE is defined in Access as 'Number', not 'date'. I tried 'Dim TRNADATE as Integer', 'as Long', 'as date'. They all gave me error like 'ByRef ... Mismatch'. So I picked 'Variant'. But it gave me a diff error msg as shown in the subject. Maybe 'Variant' has nothing to do with the errors.
Let me know if you want the whole program.
Please advise.
Thanks.
Sub ExportAccessDBtoExcel(dsn As String, DTE As Long)
...
ConnCmd.CommandText = "SELECT TOP 50 * FROM " & dsn _
& "ORDER BY " & DTE & "DESC"
...
Sub tnt()
ExportAccessDBtoExcel "CO_PNC_CO_RPT_NBEXTRACT", TRANDATE
End Sub