Hi Group --
I have a question that is probably an easy one for someone
who has run across this before.
I'm opening two Access databases using jet4 and setting the
Columns(sField).Properties on db2 to match those
properties for the field in db1:
cat2.tables(sTable).columns(sField).properties("default").value = _
cat1.tables(sTable).columns(sField).properties("default").value
This gives a "not found in this collection" error on cat2. The
Properties.Count in cat1 is 15 and zero for cat2. Hence, the error.
Since there's no Propertes.Add method, how do I build a properties
collection and set the "default" value for db2?
Any ideas would be appreciated.
Thanks,
-Dave
Paul Clement - 31 May 2005 16:12 GMT
¤ Hi Group --
¤
¤ I have a question that is probably an easy one for someone
¤ who has run across this before.
¤
¤ I'm opening two Access databases using jet4 and setting the
¤ Columns(sField).Properties on db2 to match those
¤ properties for the field in db1:
¤ cat2.tables(sTable).columns(sField).properties("default").value = _
¤ cat1.tables(sTable).columns(sField).properties("default").value
¤
¤ This gives a "not found in this collection" error on cat2. The
¤ Properties.Count in cat1 is 15 and zero for cat2. Hence, the error.
¤
¤ Since there's no Propertes.Add method, how do I build a properties
¤ collection and set the "default" value for db2?
¤
¤ Any ideas would be appreciated.
Might be easier to use Access SQL DDL:
cnn.Open "Provider=Microsoft.Jet.oledb.4.0;" & _
"Data Source=E:\My Documents\db1.mdb"
cnn.Execute "ALTER TABLE [Table1] ADD COLUMN [fieldname] INTEGER NOT NULL DEFAULT 0"
cnn.Execute "ALTER TABLE Table1 ADD COLUMN Id4 TEXT DEFAULT StringValue"
Intermediate Microsoft Jet SQL for Access 2000
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/ac
intsql.asp
Advanced Microsoft Jet SQL for Access 2000
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/ac
advsql.asp
Paul
~~~~
Microsoft MVP (Visual Basic)