PostgreSQL ODBC with Windows
I try to set up an ODBC-connection from my Windows-computer to the Linux-computer, where PostgreSQL runs on.
I do this using the CDatabase class:
CDatabase db;
db.OpenEx(connstr);
When I fill in all the information, I still get the window "Select Datasource". When I select it, everything runs ok.
But when I connect to the server using pgAdminII, it connects to the server without any problems; it even hasn't set up a DSN.
When I use the connection string displayed in pgAdminII like this:
CDatabase db;
db.OpenEx("Provider=MSDASQL.1;Extended Properties=\"DRIVER={PostgreSQL};DATABASE=template1;SERVER=10.0.0.153;PORT=5432;UID=postgres;PWD=*** *****;ReadOnly=0;Protocol=6.4;FakeOidIndex=0;ShowOidColumn=0;RowVersioning=0;ShowSystemTables=0;Conn Settings=;Fetch=100;Socket=4096;UnknownSizes=0;MaxVarcharSize=254;MaxLongVarcharSize=65536;Debug=0;C ommLog=0;Optimizer=1;Ksqo=1;UseDeclareFetch=0;TextAsLongVarchar=1;UnknownsAsLongVarchar=1;BoolsAsCha r=1;Parse=0;CancelAsFreeStmt=0;ExtraSysTablePrefixes=dd_;LFConversion=1;UpdatableCursors=1;DisallowP remature=0;TrueIsMinus1=0;BI=0\"")
I still get the window where I need to select the DSN. Does anybody know how I can connect to the server without setting up or selecting a DSN first?
|