ADO.NET ODBC Connection
In the .NET Framework, the OdbcConnection class provides support for the ODBC Data Provider, allowing VB.Net applications to connect to databases through the ODBC interface. To establish a connection, an instance of the OdbcConnection class is created, which takes a connection string as an argument and passes it to the constructor.
OdbcConnection
Once the OdbcConnection instance is created and the connection is established, SQL commands can be executed with the help of the Connection Object. These SQL commands enable data retrieval, manipulation, or other operations within the connected database.
After the database activities are completed, it is important to close the connection and release the associated resources. In the case of SqlConnection (which is not applicable for OdbcConnection), 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 through the ODBC Data Provider.
It's worth noting that the Close() method mentioned above is specific to the SqlConnection class, and does not apply to the OdbcConnection class. Instead, the OdbcConnection 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