DotNetBlocks
Programmer
Hello,
I am having a problem with ado.net and excel. When an upate is run, it executes fine, but i the actual updates do not take place untill i recompile the project. Plus, if i try an open the file again to do a select statment, it will not open.
Does any one have hany sugestions?
Babloome
I am having a problem with ado.net and excel. When an upate is run, it executes fine, but i the actual updates do not take place untill i recompile the project. Plus, if i try an open the file again to do a select statment, it will not open.
Does any one have hany sugestions?
Code:
'VS 2003 running on XP Pro
Function NonExecuteSQL(ByVal FilePath As String, ByVal SQL As String) As Boolean
Me.cData = New DataSet
Me.cError = ""
Try
Dim cn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & FilePath & "; Extended Properties=""Excel 8.0;""")
Dim objCmd As New OleDbCommand(SQL, cn)
Dim objReader As OleDbDataReader
objCmd.Connection.Open()
objReader = objCmd.ExecuteReader()
objCmd.Connection.Close()
Return True
Catch objError As Exception
Me.cError = Err.Description
Return False
Finally
End Try
End Function
Babloome