Working with Windows 7 and VB 6.0. When I "flag" Module 2 (listed below) and watch it execute, everything is OK with the Connection String as: "C:\Rwo1\General Ledger.mdb". However, when the calling projram executes, it attempts to access a
totally different DB ("C:\Actg\DONAR\General Ledger.mdb").

Module 2:

"Option Explicit
  Public gConn As ADODB.Connection
  Public Function OpenConnection()
    Set gConn = New ADODB.Connection
    gConn.Open ConnectionString
  End Function
  Public Function DatabasePath() As String
      DatabasePath = App.Path & "\General Ledger.mdb"
  End Function
  Public Function ConnectionString() As String
    ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" _
    & DatabasePath & ";Persist Security Info=False"
  End Function"
Why doesn't the program which follows (using an ADO DataGrid) access the DB called
in the Module? I hope someone can help.


Last edited by shabbir; 27Aug2012 at 08:54.. Reason: Code blocks