'=============================================================================================
' ##### Массив из рекордсета
'http://www.sql.ru/forum/788340/access-vba-massiv
Function FnArInRecordset2(ByVal strSQL As String) As Variant
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset(strSQL)
FnArInRecordset2 = rst.GetRows()
End Function
'---------------------------------------------------------------------------------------------
'SELECT SystemConf_Rafal.* FROM SystemConf_Rafal;
Function FnArInRecordset(ByVal strSQL As String) As Variant
'strSQL = "SELECT SystemConf_Rafal.* FROM SystemConf_Rafal;"
'Const strSQL = "SELECT IdRec, Name, DateR, Familie, " _
+ "Childer, Dolgnost, Zarplata FROM tblSotrudniki"
Dim oCon As ADODB.Connection
Set oCon = CurrentProject.Connection
If oCon.Execute(strSQL).EOF Then
MsgBox "Таблица пустая!", 64, "Содержимое таблицы"
FnArInRecordset = ""
Else
FnArInRecordset = oCon.Execute(strSQL).GetRows
End If
Set oCon = Nothing
'atemp = FnArInRecordset()
End Function
'=============================================================================================