Advertisement
Advertisement
| 05.21.2008 at 02:14PM PDT, ID: 23422564 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: |
Imports System.Data.OleDb
Public Module Module1
Public Sub Main()
Dim ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\_Test\Test Files\Book1.xls;" & _
"Extended Properties=""Excel 8.0;Hdr=No;ImportMixedTypes=Text;IMEX=1"""
Try
Using cn As New OleDbConnection(ConnectionString)
cn.Open()
Using cmd As New OleDbCommand("SELECT * FROM [Sheet1$] WHERE [F2]='abc'", cn)
cmd.ExecuteNonQuery()
End Using
End Using
Catch ex As OleDbException
MsgBox(ex.Message)
End Try
End Sub
End Module
|