OIDS column mandatory ?

From: Secrétariat <ets(at)rolland-fr(dot)com>
To: <pgsql-odbcl(at)postgresql(dot)org>
Subject: OIDS column mandatory ?
Date: 2004-08-27 17:05:13
Message-ID: 004d01c48c58$07421b00$0a00a8c0@lrp43008
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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

Browse pgsql-odbc by date

  From Date Subject
Next Message Peter Eisentraut 2004-08-27 18:44:22 Re: Returning back a resultset from a stored function
Previous Message Daniel Daoust 2004-08-27 16:40:28 Re: Returning back a resultset from a stored function