ODBC Coneectivity

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jjancy
    New Member
    • Jun 2010
    • 3

    ODBC Coneectivity

    Hello to all...

    This is my first project in VB and Ms access.I need to establish connectivity between VB as a frontend and Access as a backend using ODBC. please kindly help me how to write coding and to connect. This is the situation.

    The details of the Information Request Form should be submitted to the backend.
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    Well you can use an ODBC DSN or you can use a DSN Less connection string if you are using ADO or RDO. But since you asked about using an ODBC DSN...

    GoTo the ODBC driver manager and create an ODBC DSN that points to your database.

    Then to open the database and return records...

    Code:
    Option Explicit
    
    Private Sub Form_Load()
    Dim adoCn00 As New ADODB.Connection
    Dim adoRs00 As New ADODB.Recordset
    
    adoCn00.Open "test"
    adoRs00.Open "Select * from tblTest", adoCn00, adOpenDynamic, adLockOptimistic
    
    End Sub
    where "test" is the name that you gave the ODBC DSN...



    Good Luck

    Comment

    Working...