好的!直接进代码吧!
代码 :
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Users\HV\Desktop\samp.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes;"";"
objRecordset.Open "Select * FROM [Sheet1$]", _
objConnection, adOpenStatic, adLockOptimistic, adCmdText
objRecordSet.delete 1
错误信息 :
http://s14.postimage.org/fntmbde0x/err.jpg
超大号:
http://s7.postimage.org/4oklf867f/xls.jpg
我期望做的是从记录集中删除第一条记录,只记住记录集不更新到 XLS 中。任何帮助是极大的赞赏 :)