Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / May 2005



Tip: Looking for answers? Try searching our database.

columns.properties missing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dschl - 31 May 2005 03:36 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.

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)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.