Dim myConnection As String = "UID=USERNAME;PWD=password;DATABASE=dbname;WSID=COMPUTER-7A8D3E;APP=Microsoft Data Access Components;SERVER=COMPUTER-7A8D3E"
Private myDBConn As SqlClient.SqlConnection
myDBConn = New SqlClient.SqlConnection(myConnection)
The above is how you would form a connection a database. The myConnection string is can be generated useing "Data Sources (ODBC)" under adminstrative tools in the control panel.
You want the "File DSN" tab, and click add, follow the steps, and when you are done, open the final file in notepad, copy and paste the string, trim it down to what you see above, and you should be good.
To get information out of the database:
'Open a connection
myDBConn.Open()
Dim _dt As New DataTable
'Create a command to a stored procedure and add parameters
Dim _cmdInfo As New SqlClient.SqlCommand(StoredProcedureName, myDBConn)
With _cmdInfo
.Parameters.Add(Parameter)
.CommandType = CommandType.StoredProcedure
End With
'Create the dataadapter using our command
Dim _da As New SqlClient.SqlDataAdapter(_cmdStuInfo)
_da.SelectCommand = _cmdStuInfo
'Fill a table
_da.Fill(_dt)
myDBConn.Close()