Hi all, I have multiple clients who use quickbooks and their quickbooks files are stored locally on my computer. In my Access database, I want the user to be able to select the correct quickbooks DSN and store the full connection string to be able to run a variety of standardized queries on different quickbooks files. I thought I could force the DSN selector prompt using a dummy passthrough query and save the DSN that they choose, but it doesn't actually save the DSN and therefore I cannot access the info using querydef. It just comes up as "ODBC;" without the full connection string. Any suggestions would be appreciated.
Code:
Dim qd As QueryDef
Set qd = CurrentDb.QueryDefs("GetDSNQ")
'open the dummy query
DoCmd.OpenQuery "GetDSNQ"
'opening this query prompts the system dialog to select the DSN before running the query
DoCmd.Close acQuery, "GetDSNQ", acSaveYes
'I was hoping this would grab the selected connection string, but it does not save in the query
Me.MyClientDSN = qd.Connect
End Sub