Search Postgresql Archives

Does psqlodbc_11_01_0000-x64 support special characters?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




PostgreSQL version: 13.5

Operating system:   windows 10

Description:        


I wrote a VBA application to connect to PostgreSQL database by psqlodbc.

The application works fine when there are no special characters in the password.

When the password contains special characters (e.g. * , $ %),

the application responds with an error below:


Number: -2147467259 

Description: password authentication failed for user 'testdb'


I made an sample as below:


VBA

----------------------------- START ---------------------------------


Sub dbconnTest()

    Dim rs As ADODB.Recordset

    Dim sql As String

    Dim i As Integer

    Dim rcnt As Integer 

    

    Set cnn = New ADODB.Connection

    cnn.Open "Provider=MSDASQL;Driver=PostgreSQL Unicode;UID=postgres;port=5432;Server=localhost;Database=testdb;PWD=Gd*oB,$3Ln%pQ"

    

    Set rs = New ADODB.Recordset

    sql = "SELECT * FROM testtbl"

    

    rs.ActiveConnection = cnn

    rs.Source = sql

    rs.Open

    

    cnt = rs.Fields.Count

    rcnt = 2

    

    Do Until rs.EOF

        For i = 0 To cnt - 1

            Cells(rcnt, i + 1).Value = rs.Fields(i)

        Next

    

        rcnt = rcnt + 1

        rs.MoveNext

    Loop

    

    Set rs = Nothing

    Set cnn = Nothing

End Sub


----------------------------- END ---------------------------------



Thanks for any help!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux