Related Record Count Syntax Please

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Dec 21 19:49:57 CST 2004


On 12/21/04 7:40 PM, "Chuck Pelto" <cbpelto at pcisys.net> wrote:

>> Just you can do this in a little simple way.
>> Let you have some record in T1. You know its RecID.
>> 
>> So you can do SQL quyry
>> 
>>   curs = SELECT RecID FRON T2 WHERE Ptr = recid
>>   res = curs.RecordCont
>> 
> 
> Pursuing this activity I added three lines of code to Window 1's
> PopulatePanes() method.
> 
> dim tCursor as integer
> 
> currRecID = mDataBase.mPerson.GetRecID() // get record ID for the
> current parent record
> 
> tCursor = SELECT * FROM Person, Task WHERE mPersonPtr = currRecID //
> mPersonPtr is the field in the boTask that holds the pointer to the
> related parent record in boPerson.
> 
> I'm getting a syntax error on the last line.
> 
> * Syntax error in Window1.PopulatePanes, line 24:
> tCursor = SELECT * FROM Person, Task WHERE mPersonPtr = currRecID
> 
> So what is wrong with this?

Chuck,

Argh. I did show just pseudo code. An idea.

The correct code must be

    query = " SELECT * FROM Person, Task WHERE mPersonPtr = "
            + Str(currRecID)

    tCursor = mDatabase.SqlSelect( query )


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