[VCOM] Property error

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Jan 18 23:35:33 CST 2004


on 1/18/04 11:26 PM, Lee Miller at leemiller at madisongrp.com wrote:

> 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?

Aha, I see.

  db.BaseObject  returns NOT a name!
  
It returns VBaseObject class.

You need 

    dim BaseObject as VBaseObject
    dim name as String

    BaseObject = db.BaseObject(i)
    name = BaseObject.Name

Look in the docs for class VBaseObject.


> 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?

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list