Connecting Tech Pros Worldwide Forums | Help | Site Map

VB for Changing an ODBC connection to Postgres

Newbie
 
Join Date: Oct 2009
Posts: 2
#1: 4 Weeks Ago
Hi everyone...

I need to write a VB procedure for an Excel PivotTable that will change its cached ODBC connection to a new Postgres ODBC connection. I have part of the procedure written but I do not know all the arguements needed for the Postgres connection.

Can anyone help with a VB procedure that would switch from an existing ODBC Oracle connection to a Postgres ODBC connection?

Thanks!!!

Newbie
 
Join Date: Oct 2009
Posts: 28
#2: 4 Weeks Ago

re: VB for Changing an ODBC connection to Postgres


If you are wanting to use the same objects then you first need to close those objects before you reopen them.

Then a basic ODBC DSN is something like...
cn.connectionstring = "DSN=Pubs;UID=sa;PWD=pwd;"

so what you need to change is this connection string so it point to the other database...


For more information on http://www.connectionstrings.com



Good Luck
Newbie
 
Join Date: Oct 2009
Posts: 2
#3: 4 Weeks Ago

re: VB for Changing an ODBC connection to Postgres


I have limited VB experience. Can someone help with a VB procedure that will do this?

Thanks.
Newbie
 
Join Date: Oct 2009
Posts: 28
#4: 4 Weeks Ago

re: VB for Changing an ODBC connection to Postgres


Do you know how to use strings? That is all you are doing is building a string...
Reply

Tags
excel, odbc, pivottable