Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   Using DataGrid, VB6.0 calls wrong DB (http://www.go4expert.com/forums/using-datagrid-vb60-calls-wrong-db-t28946/)

Donarco 27Aug2012 01:49

Using DataGrid, VB6.0 calls wrong DB
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.


All times are GMT +5.5. The time now is 20:56.