Skip site navigation (1) Skip section navigation (2)

BUG #2818: ADO Field.Attributes reports NULL on NOT NULL fields

From: "Brien R(dot) Givens" <ic3b3rg(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2818: ADO Field.Attributes reports NULL on NOT NULL fields
Date: 2006-12-08 18:51:53
Message-ID: 200612081851.kB8IprCj021515@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2818
Logged by:          Brien R. Givens
Email address:      ic3b3rg(at)gmail(dot)com
PostgreSQL version: 8.2
Operating system:   Win XP
Description:        ADO Field.Attributes reports NULL on NOT NULL fields
Details: 

In ADO, the nullability of a field can be tested against its Attributes
property.  Another option is to examine the Schema.  As shown below, the
Attributes property of a NOT NULL field indicates it is nullable while the
Schema reports that it is not.

ADO Code:

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={PostgreSQL
ANSI};Server=localhost;Database=clinic;UID=clinic;PWD=c0nner99"

conn.Execute "DROP TABLE test"
conn.Execute "CREATE TABLE test (f1 INT NOT NULL)"

Set rs = Server.CreateObject("ADODB.recordset")
rs.Open "test", conn, adOpenStatic, adLockReadOnly, adCmdTableDirect

Response.Write ((rs(0).Attributes And adFldIsNullable) = adFldIsNullable) &
"<br>"
rs.Close

Set rs = conn.OpenSchema(adSchemaColumns,Array(Empty,Empty,"test","f1"))
Response.Write rs("IS_NULLABLE")

rs.Close
conn.Close


-- OUTPUT --

True
False

pgsql-bugs by date

Next:From: David Lee LambertDate: 2006-12-08 22:46:42
Subject: "Julian day" date format is off by 12 hours
Previous:From: Juan Pablo YaƱezDate: 2006-12-08 16:00:39
Subject: unsubscribe

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group