pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Secrétariat <ets@rolland-fr.com>
To: pgsql-odbcl@postgresql.org
Subject: OIDS column mandatory ?
Date: Fri, 27 Aug 2004 19:05:13 +0200
Message-ID: <004d01c48c58$07421b00$0a00a8c0@lrp43008> (raw)

Hello !

I want to open a recordset using ODBC (07_03_0200) in MS-VB6 (SP6) on a PG table (Linux 7.4.3) created WITHOUT OIDS.
I receive an error message  : 'Colum "oid" doesn't exist !' at the line rPG.Open "tests"...
Here are the table and the VB code.

CREATE TABLE tests
(
  court int2 NOT NULL,
  entier int4,
  long int8,
  lib30 varchar(30) NOT NULL,
  texte text,
  valeur numeric(15,2) DEFAULT 0,
  datez timestamptz DEFAULT now(),
  logique bool DEFAULT false,
  radio char(1) DEFAULT 'V'::bpchar,
  CONSTRAINT tests_pk PRIMARY KEY (court)
)
WITHOUT OIDS;
GRANT ALL ON TABLE tests TO postgres WITH GRANT OPTION;

Option Explicit
Private cPG As New ADODB.Connection
Private rPG As New ADODB.Recordset

Private Sub Form_Load()
    Dim strCpg As String
    strCpg = "DSN=TESTS"
    strCpg = strCpg & ";UID=postgres"
    strCpg = strCpg & ";PWD=password"
    strCpg = strCpg & ";Database=TESTS"
    cPG.Open strCpg
    rPG.Open "tests", cPG, adOpenDynamic, adLockBatchOptimistic, adCmdTableDirect
    ...
End Sub

Private Sub Form_Unload(cancel As Integer)
    rPG.Close
    cPG.Close
    Set rPG = Nothing
    Set cPG = Nothing
End Sub

ODBC configuration (cPG returns) :
Provider=MSDASQL.1; Extended Properties="DSN=TESTS; _
DATABASE=TESTS;SERVER=192.168.0.15;PORT=5432; _
UID=postgres;PWD=password; _
adOnly=0;Protocol=6.4;FakeOidIndex=0;ShowOidColumn=1; _
wVersioning=0;ShowSystemTables=0;ConnSettings=; _
tch=100;Socket=4096;UnknownSizes=0;MaxVarcharSize=254; _
xLongVarcharSize=8190;Debug=0;CommLog=0;Optimizer=1; _
qo=1;UseDeclareFetch=0;TextAsLongVarchar=1; _
knownsAsLongVarchar=0;BoolsAsChar=0; _
parse=0;CancelAsFreeStmt=0;ExtraSysTablePrefixes=dd_;; _LFConversion=1;UpdatableCursors=1;DisallowPremature=0; _
TrueIsMinus1=0;BI=-5;ByteaAsLongVarBinary=0;UseServerSidePrepare=0"

Would pgsqlODBC require an OIDS column on all the tables ?

Luc

Message-ID: <004d01c48c58$07421b00$0a00a8c0@lrp43008>
Permalink:  ../004d01c48c58$07421b00$0a00a8c0@lrp43008/
Also on:    postgresql.org/message-id/004d01c48c58$07421b00$0a00a8c0@lrp43008

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: ets@rolland-fr.com, pgsql-odbcl@postgresql.org
  Subject: Re: OIDS column mandatory ?
  In-Reply-To: <004d01c48c58$07421b00$0a00a8c0@lrp43008>
  References: <004d01c48c58$07421b00$0a00a8c0@lrp43008>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox