Function Conectar()
Set cn = New ADODB.Connection
With cn
    .CursorLocation = adUseServer
   .Open ("Provider=MsDataShape.1;Persist Security Info=False;User ID=postgres;Extended Properties=""DSN=PostgreSQL;DATABASE=rafa;SERVER=localhost;PORT=5432;SSLMODE=prefer;UID=postgres;PWD=123456;ReadOnly=0;Protocol=6.4;FakeOidIndex=0;ShowOidColumn=0;RowVersioning=0;ShowSystemTables=0;ConnSettings=;Fetch=100;Socket=8192;UnknownSizes=0;MaxVarcharSize=254;MaxLongVarcharSize=8190;Debug=0;CommLog=0;Optimizer=1;Ksqo=1;UseDeclareFetch=0;TextAsLongVarchar=1;UnknownsAsLongVarchar=0;BoolsAsChar=1;Parse=0;CancelAsFreeStmt=0;ExtraSysTablePrefixes=dd_;;LFConversion=1;UpdatableCursors=0;DisallowPremature=0;TrueIsMinus1=0;BI=0;ByteaAsLongVarBinary=0;UseServerSidePrepare=0;LowerCaseIdentifier=0 """)
End With
End Function

no funciona el driver con esta coneccion saler error;