Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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

ÓÐ問༺


Ïà¹ØÎÊ´ð£º

ODBC Microsoft accessµÇ¼ʧ°Ü

н¨µ¥Îĵµ³ÌÐòÑ¡ÔñODBCÖеÄÊý¾ÝԴʱ×ÜÊǵ¯³öÒ»¸öµÇ¼´°¿ÚÒªÊÚȨ¡£¡£¡£»¹ÒªÃÜÂë¡£¡£¡£
      ÆäËûµÄµ÷ÓÃODBCÖеÄÊý¾ÝÔ´ÊǾͲ»ÐèÒªÕâ¸ö£¬¿ÉÒÔÔËÐС£
  ŪÁ˺ó¤Ê±¼äÁË¡£¡£¡£
ûÓö¼û¹ý£¬¿ ......

accessÁбí¿òÊý¾Ý¶ªÊ§

¸÷λ´óÏÀ£º
            ÔÚ´°ÌåÀïÓÐÒ»Áбí¿ò£¬ÃûÔ»¡°ÉÌÆ·±àºÅ¡±£¬ÐÐÀ´Ô´ÀïµÄÄÚÈÝÓУºÉÌÆ·±àºÅºÍÉÌÆ·Ãû£¨À´×ÔÉÌÆ·±í£©¡£
  µ«ÊÇÎÊÌâ³öÏÖÁË£ºÔ­À´ÉÌÆ·±íÀïµÄÉÌÆ·±àºÅÊÇ4λ£ ......

c# ÓÃadox´´½¨accessÊý¾Ý¿â,´ò²»¿ª,Ìáʾ²»¿Éʶ±ð

CatalogClass cat=new CatalogClass();
cat.Creat(@"provider=microsoft.jet.oledb.4.0;data source="+path+";");


ÓÃÒÔÉÏ´úÂë´´½¨Îļþ³É¹¦ÁË£¬ÕÒµ½Îļþºó´ò¿ª£¬Ìáʾ²»¿Éʶ±ðµÄÊý¾ ......

access±íÖÐʱ¼ä²îµÄÉú³É

access±íÖÐÓÐ3¸ö×ֶΣ¬starttime£¬endtime£¬timespan£¬
ÊäÈëÇ°Á½¸öÖµºóÔõô×Ô¶¯Éú³ÉtimespanÄØ
´´½¨²éѯ¡£

select *, endtime-starttime from your table


»òÕßÔÚÄãµÄÊäÈë´°ÌåÖÐÓÃVBA´úÂëʵÏÖ¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ