How to obtain connection from VBA to execute insert query
Posted: Mon 20 Jun 2016 13:44
Hello,
I am new to this forum; I am test-driving the Excel add-in for PostgreSQL but cannot figure out how to obtain the connection from my VBA scripts to perform an insert/update operation on Excel 2016.
The connection to the database is set up and works fine (the sheets are loaded with the data from the corresponding tables). I have a dialog that pops up when I select a row to perform different operations on the database (inserts, updates, depending on context).
I know how to set up a connection using an ADODB object, but I have not been able to find any code samples that point my in the right direction to using the Devart add-in.
I do not know if I need to enable any project references, etc.
My connection is called PostgreSQLConnectionQA, I have tried setting it as Provider, but nothing:
Set cnn = CreateObject("ADODB.Connection")
cnn.Provider = "PostgreSQLConnectionQA"
' cnn.ConnectionString = "DSN=PostgreSQLConnectionQA;"
Thank you in advance for your help.
Best regards
I am new to this forum; I am test-driving the Excel add-in for PostgreSQL but cannot figure out how to obtain the connection from my VBA scripts to perform an insert/update operation on Excel 2016.
The connection to the database is set up and works fine (the sheets are loaded with the data from the corresponding tables). I have a dialog that pops up when I select a row to perform different operations on the database (inserts, updates, depending on context).
I know how to set up a connection using an ADODB object, but I have not been able to find any code samples that point my in the right direction to using the Devart add-in.
I do not know if I need to enable any project references, etc.
My connection is called PostgreSQLConnectionQA, I have tried setting it as Provider, but nothing:
Set cnn = CreateObject("ADODB.Connection")
cnn.Provider = "PostgreSQLConnectionQA"
' cnn.ConnectionString = "DSN=PostgreSQLConnectionQA;"
Thank you in advance for your help.
Best regards