Thread: BUG: copyConnAttributes should decode_or_remove_braces for user name too

BUG: copyConnAttributes should decode_or_remove_braces for user name too

From
Першин Юрий Петрович
Date:

Hi

1. Create user:

CREATE ROLE "{te{}st" NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT LOGIN PASSWORD '{}p';

 

2. Create pgpass.vbs file

Set c = CreateObject("ADODB.Connection")

c.Open "database=POLL_TEST;Server=test-serv14.test.domain.com;UID={{te{}}st};Provider=MSDASQL;Password={{}}p};Driver={PostgreSQL UNICODE};Port=5432;Debug=1;"

Set cmd = CreateObject("ADODB.Command")

Set cmd.ActiveConnection = c

cmd.CommandText = "SELECT 1"

cmd.CommandType = 1 'adCmdText

Set r = CreateObject("ADODB.Recordset")

r.Open cmd, , 1, 3, 1 'ctKeySet, ltOptimistic, adCmdText

MsgBox r.Fields(0).Value

r.Close

 

3. execute wscript.exe pgpass.vbs