标签:comm VID erro set OLE div sql code tab
可以在xls文件打开的情况下直接操作,并在Excel或Wps中直接更新。需要引用ADO Library。
Private Sub Command1_Click() On Error Resume Next Dim adoConn As New ADODB.Connection Dim adoReco As New ADODB.Recordset Set adoConn = New ADODB.Connection adoConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=D:/1.xls;Extended Properties=‘Excel 8.0;HDR=Yes‘" Sql = "Num int, Name char(20)" adoConn.Execute "Create table [D:/1.xls].Sheet1" & "(" & Sql & ")" adoConn.Execute "insert into [sheet1$] values (999,‘zichu‘)" adoConn.Execute "insert into [sheet1$] values (888,‘jingyi‘)" adoConn.Execute "UPDATE [sheet1$] Set Name=‘JingYi‘ Where Num=888" adoConn.Close Set adoConn = Nothing End Sub
标签:comm VID erro set OLE div sql code tab
原文地址:https://www.cnblogs.com/chenxiehan/p/12585323.html