用DAO操作EXCEL、DBASE

时间:2021-07-15 09:07:21
【文件属性】:

文件名称:用DAO操作EXCEL、DBASE

文件大小:25KB

文件格式:DOC

更新时间:2021-07-15 09:07:21

VB DAO EXCEL DBASE

Dim db As Database, rs As Recordset 打开DBF文件: Set db = OpenDatabase("d:\tmp", False, False, "dbase 5.0") Set rs = db.OpenRecordset("select * from test", dbOpenDynaset) 打开XLS文件: Set db = OpenDatabase("d:\tmp.xls", False, False, "EXCEL 8.0;HDR=Yes;") Set rs = db.OpenRecordset("select * from [Sheet1$]", dbOpenDynaset) 导出DBF文件 Set db = OpenDatabase(“Test.mdb”, False, False) db.Execute “select * into [dbase 5.0;database=d:\].test.dbf from test” 导出XLS文件 Set db = OpenDatabase(“Test.mdb”, False, False) db.Execute “select * into [Excel 8.0;database=d:\test.xls].sheet1 from test”


网友评论