I have a Pervasive database to which I can successfully connect and view the records, but now I would just like to Find a record in my database. Can someone please assist me with this please? I use Microsoft Visual Basic 2008
The Var TempInv_No has a integer value of "61809" but I get the Error: "Cannot perform '=' operation on System.String and System.Int32."
The same method with Access works 100% but with Pervasive it doesn't work
Thanx in Advance
Dim dr As DataRow()
Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim da As New OleDb.OleDbDataAdapter
Dim sql As String
cpath = "P:\HH2003"
con.ConnectionString = "Provider=PervasiveOLEDB;Data Source=" & cpath
sql = "SELECT * FROM Invoices ORDER BY DocumentNumber"
da = New OleDb.OleDbDataAdapter(sql, con)
dr = ds.Tables("Invoices").Select("DocumentNumber = " & (TempInv_no))
If Not (dr Is Nothing) AndAlso dr.Length > 0 Then
MessageBox.Show("Found Invoice: " & dr(0)("DocumentNumber").ToString())
IsinPervasive = True