Hi everybody.
I've converted vb6 data project (that worked just fine) to vb2005.
On my form there is ado control and no problem occurs when I'm searching for existing record in my db(ms access file). However when I try to find missing record after <adodc>.Refresh() my <adodc>.BOF and <adodc>.EOF become True and nothing can change it.
So please give me an idea how can I change it back for next queries.
This is my code:
Try
Dim connectPath As String
connectPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPATH & ";Persist Security Info=False"
Me.data1.ConnectionString = connectPath
If frmSearch.Tag <> "" Then
Me.data1.RecordSource = "select * from Archive where " & frmSearch.Tag & " ORDER BY tapeId, prod, article"
Else
Me.data1.RecordSource = "select * from Archive ORDER BY tapeId, prod, article "
End If
MSFlexGrid1.DataSource = CType(data1, msdatasrc.DataSource)
If data1.EOF = False And data1.BOF = False Then
Me.data1.Refresh()
End If
Catch ex As Exception
MessageBox.Show(ex.ToString(), Me.Name, MessageBoxButtons.OK)
End Try
Thanks ahead for your advise.
Regards Joel
I've converted vb6 data project (that worked just fine) to vb2005.
On my form there is ado control and no problem occurs when I'm searching for existing record in my db(ms access file). However when I try to find missing record after <adodc>.Refresh() my <adodc>.BOF and <adodc>.EOF become True and nothing can change it.
So please give me an idea how can I change it back for next queries.
This is my code:
Try
Dim connectPath As String
connectPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPATH & ";Persist Security Info=False"
Me.data1.ConnectionString = connectPath
If frmSearch.Tag <> "" Then
Me.data1.RecordSource = "select * from Archive where " & frmSearch.Tag & " ORDER BY tapeId, prod, article"
Else
Me.data1.RecordSource = "select * from Archive ORDER BY tapeId, prod, article "
End If
MSFlexGrid1.DataSource = CType(data1, msdatasrc.DataSource)
If data1.EOF = False And data1.BOF = False Then
Me.data1.Refresh()
End If
Catch ex As Exception
MessageBox.Show(ex.ToString(), Me.Name, MessageBoxButtons.OK)
End Try
Thanks ahead for your advise.
Regards Joel
Last edited: