Adodc.EOF/BOF problem

Joelson

New member
Joined
Mar 6, 2008
Messages
3
Programming Experience
Beginner
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
 
Last edited:
P.S.
In case the first query is for missing record .BOF&.EOF become true right after this line:
MSFlexGrid1.DataSource = CType(data1, msdatasrc.DataSource)

Thanks again
Joel
 
Thanks for reply.
Unfortunately the project is not designed in UI-BI-DAL archetecture :(
So, in order to rewrite DAL I'll have to write the whole project from the beginning.
 

Latest posts

Back
Top