Friday, August 27, 2010

VB6.0 Table EXPORT to EXCEL

Private Sub Command3_Click()

Dim db As Database
Set db = OpenDatabase(App.Path & "\db1.mdb")
db.Execute "SELECT * INTO [Excel 8.0;DATABASE=d:\test.XLS].[atmmsttable] FROM [atmmstdatabase]"
Set db = Nothing
MsgBox "Saved XLS to D:\test.xls", vbInformation, "Complete"


End Sub

No comments: