V
Vsn
Hi all,
In below code, would it be possible to change the recordset, by means of a
SQL statment in the string MySQL, with an query name?
'Data export section
Dim dbCurr As DAO.Database
Dim rsCurr As DAO.Recordset
Dim fldCurr As DAO.Field
Dim intCurrColumn As Integer
Set dbCurr = CurrentDb()
Set rsCurr = dbCurr.OpenRecordset(MySQL)
If rsCurr.BOF = False And rsCurr.EOF = False Then
intCurrColumn = 1
With objActiveWksh
For Each fldCurr In rsCurr.Fields
.Cells(1, intCurrColumn) = fldCurr.Name
intCurrColumn = intCurrColumn + 1
Next fldCurr
.Cells(2, 1).CopyFromRecordset rsCurr
End With
End If
I would like to make a routine which accepts a query or an SQL string.
Thanks for advice,
Ludovic
In below code, would it be possible to change the recordset, by means of a
SQL statment in the string MySQL, with an query name?
'Data export section
Dim dbCurr As DAO.Database
Dim rsCurr As DAO.Recordset
Dim fldCurr As DAO.Field
Dim intCurrColumn As Integer
Set dbCurr = CurrentDb()
Set rsCurr = dbCurr.OpenRecordset(MySQL)
If rsCurr.BOF = False And rsCurr.EOF = False Then
intCurrColumn = 1
With objActiveWksh
For Each fldCurr In rsCurr.Fields
.Cells(1, intCurrColumn) = fldCurr.Name
intCurrColumn = intCurrColumn + 1
Next fldCurr
.Cells(2, 1).CopyFromRecordset rsCurr
End With
End If
I would like to make a routine which accepts a query or an SQL string.
Thanks for advice,
Ludovic