Excle导入SQL:
'引用ADO(Microsoft ActiveX Data Objects 2.X Library)
Private Sub Command1_Click()
On Error GoTo err
Dim cn As New ADODB.Connection
cn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=123;Initial Catalog=dataBase001;Data Source=mySERVICE"
cn.CursorLocation = adUseClient
cn.Open
cn.Execute "select * into table4 from OpenRowSet('microsoft.jet.oledb.4.0','Excel 8.0;HDR=Yes;database=c:\Test.xls;','select * from [Sheet1$]')"
cn.Close
Set cn=Nothing
Exit Sub
err:
MsgBox err.Description
End Sub