ACCESS ADO
New member
- Joined
- May 18, 2006
- Messages
- 3
Hi all,
I have a very strange problem with accessing and reading from my access database.
my .mdb file is password protected, the pass is "12345".
ok, the code works fine when I want to read data from Table "SC"
but when I want to read the data from Table "Groups" I cannot!!!
you simply can replace this code with the one is my form_load event:
and will see that it wont work anymore!
pleassssseeeeeeee help meeeeeee!
I have a very strange problem with accessing and reading from my access database.
my .mdb file is password protected, the pass is "12345".
ok, the code works fine when I want to read data from Table "SC"
but when I want to read the data from Table "Groups" I cannot!!!
you simply can replace this code with the one is my form_load event:
and will see that it wont work anymore!
pleassssseeeeeeee help meeeeeee!
Code:
Dim STrPath = System.IO.Directory.GetCurrentDirectory & "\0.mdb"
Try
DB = New OleDbConnection("Provider=microsoft.jet.oledb.4.0; data source=" & STrPath & ";jet oledb:database password=12345")
Dc = New OleDbCommand("Select * from Groups where GroupName<>null order by name asc")
DB.Open()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "")
End
End Try
Dc.Connection = DB
Dim Dr As OleDb.OleDbDataReader = Dc.ExecuteReader
GroupComboBox.Items.Clear()
While Dr.Read
GroupComboBox.Items.Add(Dr("GroupName"))
End While
DB.Close()