ADO - adSchemaColumns doesn't seem to work.

Поиск
Список
Период
Сортировка
От Phil Brierley
Тема ADO - adSchemaColumns doesn't seem to work.
Дата
Msg-id AANLkTilH_YrwYHulCT4lu_2PcKIpz6Gk1j7SL0Irlk6X@mail.gmail.com
обсуждение исходный текст
Ответы Re: ADO - adSchemaColumns doesn't seem to work.  (Richard Broersma <richard.broersma@gmail.com>)
Список pgsql-odbc
Hi,
 
I have some standard code below that seems to work fine with all databases I have tested including teradata, oracle, sql server etc.
 
All I am trying to do is return a record set object to the data in a table.
 
I've just installed and tested it on postgres and it gives me an error -
 
'object or provider is not capable of performing requested operation'
 
can anyone give me any clues as to what I am missing?
 
The code below can be tested in excel if you add a reference to ADO.
 
Public Sub test()
    'connect
    Dim cnSim As New ADODB.Connection
    Dim connectionstring As String
    connectionstring = "Provider=PostgreSQL.1;Password=password;User ID=postgres;Data Source=localhost;Location=postgres;Extended Properties="""""
    cnSim.connectionstring = connectionstring
    cnSim.Open
   
   
    'list the tables
    Dim s As String
    Dim s1 As String
    Dim rs As New ADODB.Recordset
   
    Set rs = cnSim.OpenSchema(adSchemaTables)
   While Not rs.EOF
      s = rs!Table_Schema & "." & rs!TABLE_NAME
      s1 = rs!TABLE_NAME
      Debug.Print s
      rs.MoveNext
   Wend
   
   'works fine to here.
   
    'try to return record set of a table
    Dim aRestrictions As Variant
    aRestrictions = Array(Empty, Empty, s, Empty)
    'aRestrictions = Array(Empty, Empty, s1, Empty)
    Set rs = cnSim.OpenSchema(adSchemaColumns, aRestrictions)
    'Error - object or provider is not capable of performing requested operation'
   
End Sub

В списке pgsql-odbc по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: error compiling psqlodbc-08.04.0200 under red hat 5
Следующее
От: Jaime Casanova
Дата:
Сообщение: memory leak in psqlodb 08.04.0200