Question:

Data accessing using vb6.0 as frontend and access as backend?

by  |  earlier

0 LIKES UnLike

Data accessing using vb6.0 as frontend and access as backend?

 Tags:

   Report

1 ANSWERS


  1. Yup.

    Requires reference to Microsoft ActiveX Data Objects 2.x OCX.

    sub connect

    dim connectionstring as string

       Dim oConn As ADODB.Connection, rs As ADODB.Recordset

       Dim strSQL As String

    ' Remove all spaces in the connectionstring

    ConnectionString="Provider=Microsoft. Jet. OLEDB. 4.0; Data Source= FILENAME.accdb"

       Set oConn = New ADODB.Connection

       oConn.ConnectionTimeout = 60

       oConn.Open ConnectionString

       strSQL = txtQuery.Text' Assumes a textbox used to enter query

       Set rs = New ADODB.Recordset

       rs.Open strSQL, oConn, adOpenStatic, adLockReadOnly

      

    ' Do stuff with recordest here

       rs.Close

       Set rs = Nothing

       oConn.Close

       Set oConn = Nothing

    end sub

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.