Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Location
    Lahore, Pakistan
    Posts
    1

    Post Unanswered: Connecting an ACCESS db with VB ActiveX

    I want to cennect an Access database with my designed activex. How can I do it, can anybody tell me the code and procedure?

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Question is this what u mean

    Dim HisConn As New ADODB.Connection ' ADOBD Connection DataBase
    Dim HisRS As New ADODB.Recordset ' ADOBD Recordset
    Dim cmdSQL As ADODB.Command ' ADOBD Command String
    Dim AdodcCo As String ' ADOBD String

    AdodcCo = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" & GblxDBPath
    Set HisConn = New ADODB.Connection
    HisConn.Open AdodcCo

    Set HisRS = New ADODB.Recordset
    HisRS.CursorType = adOpenDynamic
    HisRS.LockType = adLockReadOnly

    Set cmdSQL = New ADODB.Command
    Set cmdSQL.ActiveConnection = HisConn

    cmdSQL.CommandText = "Select * FROM X ORDER BY Y"
    HisRS.Open cmdSQL.CommandText, HisConn, 1, 1, adCmdText

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •