易截截图软件、单文件、免安装、纯绿色、仅160KB

Access導出Execl

VB+Access做的系統,
怎樣把數據庫Access內容導出execl?
现在没东西试,从网上找了段代码你看看
VB code:

Private Sub ExportOneTable()

'EXPORTS TABLE IN ACCESS DATABASE TO EXCEL
'REFERENCE TO DAO IS REQUIRED

Dim strExcelFile As String
Dim strWorksheet As String
Dim strDB As String
Dim strTable As String
Dim objDB As Database

'Change Based on your needs, or use
'as parameters to the sub
strExcelFile = "C:\My Documents\MySpreadSheet.xls"
strWorksheet = "WorkSheet1"
strDB = "C:\My Documents\MyDatabase.mdb"
strTable = "MyTable"

Set objDB = OpenDatabase(strDB)

'If excel file already exists, you can delete it here
If Dir(strExcelFile) <> "" Then Kill strExcelFile

objDB.Execute _
"SELECT * INTO [Excel 8.0;DATABASE=" & strExcelFile & _
"].[" & strWorksheet & "] from " & "[" & strTable & "]"
objDB.Close
Set objDB = Nothing

End Sub





http://download.csdn.net/source/1483928

引用
http://download.csdn.net/source/1483928

TKS!


引用
http://download.csdn.net/source/1483928

有問༺


相关问答:

php 使用 ADODB 连接Access 的问题

<?php

include("adodb/adodb.inc.php");

$db = &NewADOConnection("access");
$access = realpath("Data.mdb");
$dsn = "Provider=Microsoft.J ......

VB.net操作Access问题

用的是2008写了一段判断数据库DbName中是否有表TabName的程序,但是在调用的时候出现了数据库名称不能转换为Double型数据的问题,但是在这当中我根本没有设置Double型数据,刚开始接触VB.net,不是很懂,大家帮忙啊 ......

access vba 数组长度

access vba 中怎么取得数组长度?
数组行?
UBound(数组名)

ubound()-lbound()

UBound 函数
     

返回一个 Long 型数据,其值为指定的数组维可用的最大下标。

语法 ......

ACCESS数据库关联查询问题?

初用ACCESS数据库,要实现一个关联查询,sql语句如下:select pid,product_Type.name as tid,name,img_url,context,remark from Product join product_Type on product.type_id = product_Type.type_id order by pid ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号