ADO.NET Connection <dbConnection>

Synopsis

This design is used to provide access to the database through ADO.Net mechanisms.

Parameters

Name Type Description
dataProvider name ADO.Net data provider. Possible values: :ODBC :OLEDB :SQLSERVER :ORACLE
connectionString string Connection String. Please refer to the documentation on the server provider. A lot of examples are at www.connectionstrings.com
onNullReturn any Intent substitutes the values of dbNull with the value of this parameter. If dbNull values are not desired, you may use: RaiseError("Encountered NULL") as a value of parameter

Methods

GetTableNames( ) As List
Returns the list of the Table Names for given connection
GetColumnNames( table As String ) As List
Returns the list containing the names of all columns in the given table.
GetProcedureNames( ) As List
Returns a list containing the names of all the procedures in the data source.
BuildQueryString( table As String, _
                  Optional fields As String = "*", _
                  Optional where As String = "", _
                  Optional orderBy As String = "" ) As String
Builds a SELECT query string using input strings for clauses.
GetQueryResultsByRow( sqlQuery As String ) As List 
Returns the List of Lists of the query results. Outer lists correspond to different rows.
GetQueryResultsByColumn( sqlQuery As String ) As List
Returns the List of Lists of the query results. Outer lists correspond to different columns.
ReplaceDbNull( val As Any ) As Any
Replaces dbNull value with onNullReturn

Connection to OLEDB database

Child Name: OleDBConnection
Child Design: dbConnection
Name Type Supplied
dataProvider name :OLEDB
connectionString string "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\1\TESTDB\AutoLot.accdb"

Connect to SQL Server

Child Name: SQLServerConnection
Child Design: dbConnection
Name Type Supplied
dataProvider name :SQLSERVER
ConnectionString string "Data Source=(local)\SQLEXPRESS;Integrated Security=True"

Obtain the table data

dbConnection.GetQueryResultsByRow("Select * from ViewTable")