MyPath = "C:\Documents and Settings\xiaoapen\桌面\apeng0123\"
MyFile = Dir(MyPath & "*.txt") ' 找寻第一项。
Do While MyFile <> "" ' 开始循环。
If myname <> "." And myname <> ".." Then
If (GetAttr(MyPath & MyFile) And vbDirectory) <> vbDirectory Then
Debug.Print MyFile
DoCmd.TransferText , "导入规格", "原始", MyPath & MyFile, False
DoCmd.OpenQuery "查询1"
qqqqq
DoCmd.OpenQuery "查询2"
DoCmd.OpenQuery "查询3"
Call del_errTab
Compact
End If
End If
MyFile = Dir ' 查找下一个目录。
Loop
End Sub作者: andymark 时间: 2007-1-25 04:23
压缩当前数据库,调用下面的命令
Public Sub qqqqq()
Dim rs As DAO.Recordset
Dim s1 As String
Set rs = CurrentDb.OpenRecordset("原始")
rs.MoveFirst
s1 = rs(1)
rs.MoveNext
Do Until rs.EOF
If IsNull(rs(1)) Then
rs.Edit
rs(1) = s1
rs.Update
Else
s1 = rs(1)
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing