While SQL Server Express is the normal way of doing database storage in a Visaul Basic Express application, you have serveral alternatives available within Visual Basic Express. OLE DB (it stands for Object Linking and Embedding Database) is Microsoft's way of providing a generic database standard.
In the case of QODBC, the "QuickBooks Data" System DSN is called through the Microsoft OLE DB Privider for ODBC Drivers - MSDASQL.DLL. The differences become apparent when writing code. Whereas SQL databases are accessed through the System.Data.SqlClient set of classes, QODBC tables are processed using the system.Data.OleDB classes.
From server explorer or from the data menu if you select "add Connection" you should get a dialog box to appear with the first textbox being: "Data Source". If you click the "change" button you should get a list of all installed datasources and providers...if your list only shows Access and SQL then that is all that is recognized as installed on your machine.
You can get the latest MDAC from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=6C050FE3-C795-4B7D-B037-185D0506396C&displaylang=en
While Visual Basic Express does not provide design time support for ODBC connection in the data source wizard. You can still connect to ODBC data source using the OdbcConnection class (http://msdn2.microsoft.com/en-us/library/system.data.odbc.odbcconnection.aspx).
The following code is the minimal code required to create a DataSet from the SQL statement and attaches the dataset to a DataGrid:
Dim cnQODBC As System.Data.Odbc.OdbcConnection Dim daQODBC As System.Data.Odbc.OdbcDataAdapter Dim dsQODBC As System.Data.DataSet
cnQODBC = New System.Data.Odbc.OdbcConnection("DSN=QuickBooks Data") cnQODBC.Open() daQODBC = New System.Data.Odbc.OdbcDataAdapter("SELECT ListID, FullName, CompanyName FROM Customer", cnQODBC) dsQODBC = New System.Data.DataSet
daQODBC.Fill(dsQODBC) dgDataGrid.DataSource = dsQODBC dgDataGrid.DataBind() 'May or maynot be required depending on where you put this code. |