When I do a query that selects 0 records I get an error. How to avoid this? Here's my code:There is a peice of code I added to manage this case, but when I add a row to the table and update, the operations goes OK, but I don't have my row in the database.VB Code:
DA = New OleDbDataAdapter(Query, myConnString) Dim CB As New OleDb.OleDbCommandBuilder(DA) DA.InsertCommand = CB.GetInsertCommand DA.UpdateCommand = CB.GetUpdateCommand DA.DeleteCommand = CB.GetDeleteCommand Try DA.Fill(DS, Table) ' This is where I get the generic error Catch e As OleDbException ' I added this code Try DA.FillSchema(DS, SchemaType.Mapped, Table) Catch ex As Exception MsgBox(ex.ToString) End Try End Try
Thx




Reply With Quote