ADO.NET OLEDB Connection
The OleDbConnection class enables connectivity to databases through the OLEDB Data Provider. When working with VB.Net applications, an instance of the OleDbConnection class is created to establish the connection. The constructor of the OleDbConnection class accepts a connection string as an argument, which is then used to establish the connection.
OleDbConnection
After creating an instance of the OleDbConnection class and successfully establishing the connection, SQL commands can be executed using the Connection Object. These SQL commands allow for data retrieval, manipulation, or any other necessary operations within the connected database.
Once the database activities are completed, it is essential to close the connection and release the associated resources. In the case of SqlConnection (which is not applicable for OleDbConnection), the Close() method is used to close the database connection. This method also rolls back any pending transactions and releases the connection from the database connected via the OLEDB Data Provider.
However, it's important to note that the Close() method mentioned above is specific to the SqlConnection class and does not apply to the OleDbConnection class. The OleDbConnection class provides its own Close() method to close the connection and release resources.
Full Source VB.NETYou have to provide the necessary informations to the Connection String.
From the above statement replace yourdatabasename.mdb to the actual names.
- ADO.NET ExecuteNonQuery in SqlCommand Object
- ADO.NET ExecuteNonQuery in OleDbCommand Object
- ADO.NET ExecuteScalar in SqlCommand Object
- ADO.NET ExecuteScalar in OleDbCommand Object
- ADO.NET ExecuteReader in SqlCommand Object
- ADO.NET ExecuteReader in OleDbCommand Object
- How to ADO.NET DataReader
- How to ADO.NET SqlDataReader
- How to ADO.NET OleDbDataReader
- How to Multiple Result Sets in ADO.NET
- Getting Schema Informations from SqlDataReader
- Getting Schema Informations from OleDbDataReader
- What is DataAdapter
- What is SqlDataAdapter
- What is OleDbDataAdapter
- Vb.NET ExecuteReader and ExecuteNonQuery