ник: als
Сделано так
Private Sub LoadGoods()
Dim SFile As String
Dim DFile As String
Dim MyFile As String
Dim MyPath As String
Dim MyName As String
Dim tmpSql As String
Dim DBFConnection As ADODB.Connection
Dim DConnection
SFile = "C:\Bufer\sect1.txt"
MyFile = Dir("C:\Bufer\sect1.txt")
If MyFile <> "" Then
DFile = "C:\Bufer\sect1.tmp"
Name SFile As DFile
SFile = "C:\Bufer\sect1.tmp"
DFile = "C:\sect1.txt"
FileCopy SFile, DFile
Kill SFile
DConnection = Me.cdbGoods.ConnectionString
bBeep = False
bAllowOperate = True
Set DBFConnection = New ADODB.Connection
DBFConnection.Open (DConnection + ";Password=system5")
tmpSql = "DELETE * FROM Goods"
DBFConnection.BeginTrans
DBFConnection.Execute (tmpSql)
DBFConnection.CommitTrans
tmpSql = "INSERT INTO Goods ( ID, Name, Price, Otd, LastPrice) SELECT Goods1.ID, Goods1.NAME, Goods1.PRICE, Goods1.OTD, Goods1.PRICE FROM Goods1;"
DBFConnection.BeginTrans
DBFConnection.Execute (tmpSql)
DBFConnection.CommitTrans
Me.cdbGoods.Refresh
DBFConnection.Close
End If
End Sub