问题
I am trying to create some VBA code to automate dashboard creation against a PostgreSQL database. I have heard the OLE DB driver is unreliable and it looks like it hasn't been touched in several years. Does ADO work with an ODBC driver?
回答1:
Yes, simply reference the DSN:
oConn.Open "DSN=mySystemDSN;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"
来源:https://stackoverflow.com/questions/9187811/does-ado-work-with-odbc-drivers-or-only-ole-db-providers