Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I have a real problem here. I am connecting to an access 2007 database (accdb) via an OLEDB connection, and I have no idea why this code isn't working!
Public Class Form1
Private Sub Form1_Load(...)
Dim dbCon As OleDbConnection
Dim dbCmd As OleDbCommand
Dim dbRead As OleDbDataReader
dbCon = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:My.accdb;Persist Security Info=False;")
dbCmd = New OleDbCommand("SELECT * FROM CITY", dbCon)
dbRead = dbCmd.ExecuteReader
Do While dbRead.Read
The result is the program crashes with no errors. I tried it in a different form/project and it launches the forum without any messages. So, in short, I'm getting no error messages and I don't know why. It will not go past dbCon.Open(). Please help!
0 · ·