Database Related [solved]
Code:
'stuff I do not understand but use:
Dim con As New OleDb.OleDbConnection
Dim dbProvider As String
Dim dbSource As String
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
dbSource = "Data Source = C:\Users\Manel\Downloads\AddressBook\AddressBook.mdb"
con.ConnectionString = dbProvider & dbSource
'end of that stuff
con.Open()
sql = "SELECT * FROM tblContacts"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "AddressBook")
MsgBox("Database is now open")
ds.Tables("AddressBook").Columns.Contains(TextBox1.Text)
If (ds.Tables("AddressBook")****ws(1).Item(1).Equals(TextBox1.Text)) Then
Dim itid As String
itid = ds.Tables("AddressBook")****ws(1).Item(0)
MsgBox("It does exist, it's ID is " + itid + "!")
Else
MsgBox("It does not")
End If
con.Close()
MsgBox("Database is now Closed")
---------------------
If (ds.Tables("AddressBook")****ws(ALL ROWS IN HERE).Item(ALL ITEMS IN HERE).Equals(TextBox1.Text)) then
Dim itid As String
itid = ds.Tables("AddressBook")****ws(ROWS WHERE ITEM EXISTS).Item(0)
MsgBox("It does exist, it's ID is " + itid + "!")
Else
MsgBox("It does not")
End If
--------------------
As an alternative if you know any database searching source-code in vb.net I'd be thankfull.
the **** is ". rows" without the space.
Thank you in advance,
omanel



