By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,696 Members | 1,512 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,696 IT Pros & Developers. It's quick & easy.

Export Access file to Excel in VB.net.

P: n/a
sam

Can you teach me how to export access file to excel file
in VB.net?

Thank in advance.
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Do you want to export an Access table to Excel?
Nov 19 '05 #2

P: n/a
Hello,

"sam" <s9******@cc.ncu.edu.tw> schrieb:
Can you teach me how to export access file to excel file
in VB.net?


You may want to ask in the Access ngs (microsoft.public.access[.*]). Then
you can translate the solution to VB .NET.

HTH,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 19 '05 #3

P: n/a
On Tue, 26 Aug 2003 07:19:52 -0700, "sam" <s9******@cc.ncu.edu.tw> wrote:


Can you teach me how to export access file to excel file
in VB.net?

You can do it a table at a time:

Public Sub ExportToExcelFromAccess()

Dim AccessConn As New System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;"
& _
"Data Source=e:\My Documents\db1.mdb")

AccessConn.Open()

'New sheet in Workbook
Dim AccessCommand As New System.Data.OleDb.OleDbCommand("SELECT * INTO [Excel
8.0;DATABASE=e:\My Documents\Book11.xls;HDR=NO;].[Sheet7] from [Table7]", AccessConn)

AccessCommand.ExecuteNonQuery()
AccessConn.Close()

End Sub
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.