On Fri, 9 Jan 2004 19:22:54 +0800, "Alice" <al******@hotmail.com> wrote:
¤ Does anybody knows how to do the above mentioned?
¤
¤ Please see below for the codes used for VB.
¤ I need codes for VB .Net 03 doing the same thing.
¤ TIA for any help.
¤
¤ strSQL = "SELECT Product_Master.* " & _
¤ "INTO [Excel 8.0;DATABASE=C:\PDT_MAS.XLS].[PDT_MAS] " & _
¤ "FROM Product_Master; "
¤ Database1.Execute strSQL
Public Sub ExportToExcelFromAccess()
'establish connection to Access database
Dim AccessConn As New System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;"
& _
"Data Source=e:\My Documents\db1.mdb")
AccessConn.Open()
Dim strSQL As New String("SELECT * " & _
"INTO [Excel 8.0;DATABASE=C:\PDT_MAS.XLS].[PDT_MAS] " & _
"FROM Product_Master")
Dim AccessCommand As New System.Data.OleDb.OleDbCommand(strSQL, AccessConn)
AccessCommand.ExecuteNonQuery()
AccessConn.Close()
End Sub
Paul ~~~
pc******@ameritech.net
Microsoft MVP (Visual Basic)