Question

First of all - this is simliar to this question --> Where is the database connection information in an ADP file?.

But I still cannot seem to find what I need.

My company is using an old, out-dated program written in MS Access. I have very little experience with MS Access - so any help would be appreciated. (And no, the European IT department of my company (who made this) refuses to provide us with any help)

I'm recreating this database system in php/MySQL, but I am trying to find the database connection details so I can connect my new program to the same SQL database connection the MS Access program is using.

According to the forementioned post:
Cntrl + G opens the VB panel. I tried searching for

? CurrentProject.Connection.ConnectionString
? CurrentProject.Connection.Provider


The only thing that was close was:

Set cn = CurrentProject.AccessConnection


One of the functions that uses this connection (VB):

Function ClosePurchasingREQ(iDPU As Long)

        Dim cn As ADODB.Connection
        Dim rs As ADODB.Recordset
        Dim cmd As ADODB.Command
       'Use the ADO connection that Access uses
        Set cn = CurrentProject.AccessConnection
        Set cmd = New ADODB.Command
        Dim prmDPU_ID As ADODB.Parameter

        Set cmd.ActiveConnection = cn
        cmd.CommandType = 4
        Dim strCMD As String
        strCMD = "ADD_DPU_CAR"
        cmd.CommandText = strCMD
        Set prmDPU_ID = cmd.CreateParameter("DPUID", adInteger, adParamInput)
        cmd.Parameters.Append prmDPU_ID
        'prmDPU_ID.Value = iDPU_ID

        cmd.Execute


End Function

Where are the SQL database credentials for me to connect the (ODBC, ADO, SQL, anything that will work with PHP) database to my new project?

Was it helpful?

Solution

In adp files, connection data is stored as metadata of the project. You cand find it in the menu File -> Connection

You'll get a dialog like this (sorry, only available MSAccess in spanish):

conection data

At runtime, CurrentProject.AccessConnection will reflect this data

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top