|
 |
activex_data_objects thread: ADOX returning incorrect Column Attributes value from linked Access 2000 table
Message #1 by "Mike Blenkiron" <mikeblenkiron@m...> on Sun, 2 Mar 2003 14:51:04 -0000
|
|
Hello all,
I was wondering whether anyone could reproduce the following error:
From within an Access 2000 database I created a simple ADOX routine to return the value of the attributes of a REQuired text column
(text_req) from a table (Table1) that was linked into the same database from another Access 2000 database. I then used the
Connection property of the Access CurrentProject object to create the ADOX Catalog and retrieved the value of the Column Attribute
as follows:
Dim catTest As ADOX.Catalog
Set catTest = New ADOX.Catalog
catTest.ActiveConnection = CurrentProject.Connection
MsgBox catTest.Tables("Table1").Columns("text_req").Attributes
Strangely, a value of 2 was returned which indicates that the column is nullable (adColNullable = 2) which is obviously incorrect
for a REQuired column. If you delete the link and import the table directly into the same database then the code runs correctly
returning a value of 0. It also runs correctly if you create a new connection which points directly to the database that physically
contains the table but not if you create a new connection that points to the (current) database containing the link.
I'd be interested to see if anyone can replicate this error and was wondering whether anyone had encountered any kind of similar
problems with Access 2000 linked tables & ADOX.
Mike Hammer
|
|
 |