Which version of .net are you interested in using the ODBC block on?
The Enterprise library has a Data Access component. It is useful on SQL, Oracle, and ODBC. Just set a different provider name in the .config file
EX:
<add name="MyConnection" connectionString="Dsn=Datasource;uid=UserID;pwd=Password"
providerName="System.Data.Odbc" />
At that point, the data access code is "standardized" and looks identical for SQL, Oracle, and ODBC
EX:
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Public Class MyClass
Private dbMyDatabase As Database
dbMyDatabase = DatabaseFactory.CreateDatabase("MyConnection")
Public Function GetMyData(ByVal FacilityCode As String) As Data.DataSet
Try
Dim SQL As String
SQL = "SELECT * from MyDataTable"
Dim cmd As Data.Common.DbCommand = dbMyDatabase.GetSqlStringCommand(SQL)
Return dbMyDatabase.ExecuteDataSet(cmd)
Catch ex As Exception
ExceptionPolicy.HandleException(ex, "All")
Throw
End Try
End Function
End Class
The address for the latest Enterprise Library is:
http://msdn.microsoft.com/en-us/library/cc467894.aspx
This is assuming you are using .net 3x.
Also note that we are using the Exception Handling block in the above code.