How VB dotnet work with Access Database
-
Hi, I'm fresh to VB dotnet,but now I'm doing a project which need to work with an Access database. Could you please give me a brief or example showing me that how can I load the database and access the datas.. Thank you so much
Connection String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=;Jet OLEDB:System Database=system.mdw;" strSQL="QUERY" ' LOAD and ACCESS DB Try cnSQL = New OleDbConnection(ConnectionString) cnSQL.Open() cmSQL = New OleDbCommand(strSQL, cnSQL) drSQL = cmSQL.ExecuteReader() If drSQL.Read() Then End If drSQL.Close() cnSQL.Close() cmSQL.Dispose() Catch Exp As OleDbException MsgBox(Exp.Message, MsgBoxStyle.Critical, "Oledb Error") Catch Exp As Exception MsgBox(Exp.Message, MsgBoxStyle.Critical, "General Error") End Try Jats