Export the query results to another method of Excel

zhaozj2021-02-16  57

Option Explicitdim DBADO AS New Adodb.ConnectionDim Cmdado As New Adodb.commanddim Sqlstr AS Stringdim Howdo As Stringdim FileName As String

Private submmand1_click () filename = app.path & "Enter new file name:", "save") & ".xls" howDO = text1.text

DBADO.OPEN ("provider = microsoft.jet.Oledb.4.0; data source =" & app.path & "/goods.mdb; prorsist security info = false")

SQLSTR = "SELECT * INTO [Excel 5.0; Database =" & FileName & "]. [data] from [Basic] Where ID in (" & Howdo & ")

DBADO.EXECUTE (SQLSTR), AdcmdText Adexecutenorecords

DBADO.CLOSE

End Sub

转载请注明原文地址:https://www.9cbs.com/read-21862.html

New Post(0)