Public Function FUN_TRANSFER_DATA(STR_PATH_BAZA As String, STR_BAZA_NAME As String, STR_TABLE_NAME As String)
' Добавление ДАННЫХ В таблицу выгрузки из арма
Dim Field As ADODB.Field
Dim WHERE_connection As ADODB.Connection ' подключение к базе КУДА
Dim RST_FROM_WHERE As ADODB.Recordset ' ОТКУДА
Dim RST_WHERE As ADODB.Recordset 'КУДА
Dim strDBPath As String ' ПУТЬ
strDBPath = FUN_Patch_File(STR_PATH_BAZA, STR_BAZA_NAME) ' ПУТЬ К НОВОЙ БАЗЕ
WHERE_connection = "provider=Microsoft.JET.OLEDB.4.0;" & _
"data source=" & strDBPath
Set RST_FROM_WHERE = New ADODB.Recordset
Set RST_WHERE = New ADODB.Recordset
RST_FROM_WHERE.Open "SELECT * " & STR_TABLE_NAME, GLB_con, adOpenKeyset, adLockOptimistic
RST_WHERE.Open "SELECT * " & STR_TABLE_NAME, WHERE_connection, adOpenKeyset, adLockOptimistic
If RST_FROM_WHERE.EOF = True Then
RST_FROM_WHERE.Close
Set RST_FROM_WHERE = Nothing
Exit Function
End If
If Not RST_FROM_WHERE.BOF Then RST_FROM_WHERE.MoveFirst
Do While Not RST_FROM_WHERE.EOF
А ТУТА ВОТ МЫ С БАРАНОМ
RST_FROM_WHERE.MoveNext
Loop
End Function
|