[VCOM] Property error

Lee Miller leemiller at madisongrp.com
Sun Jan 18 16:26:47 CST 2004


Hi Ruslan

The error is not at Db.BaseObjectCount. That works correctly and returns 
the correct number of tables. It is the next line which reports the error. 
I have tried some different arguments but page 10 of the manual clearly states:

BaseObject = db.BaseObject(i)

Is this the correct method to use to return the name of the table(s) in a 
database?

Lee


 > Here is the code
 >
 > Dim Db As VDataBase
 >    Dim CountOfTables As Long
 >    Dim sTableName As String
 >    Dim i As Variant

 >    Set Db = CreateTestDb

 >    If Not Db Is Nothing Then
 >    'Load list of tables into MSFlexGrid2
 >    i = 1
 >    CountOfTables = Db.BaseObjectCount
 >    sTableName = Db.BaseObject(i)
 >
 > At the line CountOfTables = Db.BaseObjectCount, it returns the correct
 > value, 2.
 >
 > The next line gives the following error
 >
 > "Object doesn't support this property or method."
 >
 > Isn't this how you locate the name of each table in a database?

May be you need Db.BaseObjectCount()
                                 ^^^^^

Visual BASIC sometimes need (), sometimes no.







More information about the Valentina mailing list