Dionisis,
Then send a liitle sample including the DBF file. I am sure you can make it
with just 10 lines or less.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Dionisis Divaris" <
sv1fkk@hol.gr> escribió en el mensaje
news:[email=
45efb8d2@news.xailer.com...]
45efb8d2@news.xailer.com...[/email]
> Goodmorning Ignacio
>
> Sorry for the trouble but using the syntax you gave to me bellow nothing
> happens and i get an error, see the attachment.
>
> Both Contarct and cContract are Strings Variables
>
> Regards
> Dionisis
>
> Ï "Ignacio Ortiz de Zúñiga" <
NoName@xailer.com> Ýãñáøå óôï ìÞíõìá
> news:45ee9274$[email=
1@news.xailer.com...]
1@news.xailer.com...[/email]
>> Dionsisis,
>>
>> Sorry but it seems you did not understand a word of my previous and large
>> post about this issue. It should be:
>>
>> oDBF:Filter("Contact='" + cContract + "'")
>>
>> Please reread thoughtfully my previous post.
>>
>> Regards,
>>
>> --
>> Ignacio Ortiz de Zúñiga
>>
http://www.xailer.com
>>
>>
>> "Dionisis Divaris" <
sv1fkk@hol.gr> escribió en el mensaje
>> news:45ee899c$[email=
1@news.xailer.com...]
1@news.xailer.com...[/email]
>>> Hello Ingacio
>>>
>>> A strange behavior of Filter() method:
>>>
>>> I have a FIELD variable named CONTRACT and a STATIC variable named
>>> cCONTRACT.
>>> When use the following DbSetFilter({||CONTRACT=cCONTRACT},) the
>>> filtering
>>> of dBase works fine
>>> but
>>> when use oDBF:Filter("Contact=cContract") there is no filtering of
>>> database .
>>> What happens here
>>> Regards
>>> Dionisis
>>>
>>>
>>>
>>> "Ignacio Ortiz de Zúñiga" <
NoName@xailer.com> wrote in message
>>> news:45ed2dfe$[email=
1@news.xailer.com...]
1@news.xailer.com...[/email]
>>>> Dionisis,
>>>>
>>>>> Please if you can give an examlple how to use
>>>>> TDataSet:Filetr() with some exapmles for fileters expressions.
>>>>
>>>> It depends on the kind of Dataset you are using. For DBF tables you can
>>>> use basically the same syntax you use with the SET FILTER command, but
>>>> there is an important exception: The expression passed to the method
>>>> MUST
>>>> be a complete string. In [x]Harbour when you use a sentence like:
>>>>
>>>> SET FILTER TO Age > 50
>>>>
>>>> Is preprocessed to:
>>>>
>>>> DBSETFILTER( {|| Age > 50 }, "Age > 50" )
>>>>
>>>> As you can see a codeblock and a literal is passed to the function. In
>>>> this case with only the literal any RDD could perform the filter. The
>>>> codeblock is repetitive. But in this case is not:
>>>>
>>>> SET FILTER TO Age > nAge
>>>>
>>>> Which is preprocessed to:
>>>>
>>>> DBSETFILTER( {|| Age > nAge }, "Age > nAge" )
>>>>
>>>> As you can see the codeblock holds the value of nAge, and indeed, using
>>>> the codeblock is the only way to perform the filter since the literal
>>>> is
>>>> useless due its reference to nAge. ADS, for example, can not deal with
>>>> this kind of filter, and xHarbour performs a SLOOOW local filter on
>>>> those
>>>> cases. The solution is easy, just create the filter this way:
>>>>
>>>> cFilter := "Age > " + Str( nAge )
>>>> DBSETFILTER( &( "{||" + cFilter + "}"), cFilter )
>>>>
>>>> With this little modification the reference to nAge is out, and RDDs
>>>> like
>>>> ADS can perform a really quick filter.
>>>>
>>>> This same technique is what you need to use with the TDataset:Filter()
>>>> method. That's all. These are some samples:
>>>>
>>>> oDataset:Filter( "Age > " + Str( nAge ) )
>>>> oDataset:Filter( "UPPER( First ) = 'IGNACIO'"
>>>>
>>>> The SQL engines have they own filteing syntax based on the WHERE
>>>> clause
>>>> of its SELECT command. Consult any documentation of SQL for further
>>>> information.
>>>>
>>>> Regards,
>>>>
>>>> --
>>>> Ignacio Ortiz de Zúñiga
>>>>
http://www.xailer.com
>>>>
>>>>
>>>> "Dionisis Divaris" <
sv1fkk@hol.gr> escribió en el mensaje
>>>> news:[email=
45ec6cb7@news.xailer.com...]
45ec6cb7@news.xailer.com...[/email]
>>>>> Works perfect Ignacio .
>>>>> Please if you can give an examlple how to use
>>>>> TDataSet:Filetr() with some exapmles for fileters expressions.
>>>>>
>>>>> Many thanks for your valued help.
>>>>> Regards
>>>>> Dionisis
>>>>>
>>>>> Ï "Ignacio Ortiz de Zúñiga" <
NoName@xailer.com> Ýãñáøå óôï ìÞíõìá
>>>>> news:45ebfc0b$[email=
1@news.xailer.com...]
1@news.xailer.com...[/email]
>>>>>> Dionisis,
>>>>>>
>>>>>> I guess it will be useless since the DataSet only saves the modified
>>>>>> fields. The other 8 fields will never be edited, so never saved. Is
>>>>>> by
>>>>>> far more simple to do something like this:
>>>>>>
>>>>>> METHOD DBBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
>>>>>>
>>>>>> IF !lCanceled
>>>>>> ::oDataSet:MyInvisibleField := "whatever"
>>>>>> ENDIF
>>>>>>
>>>>>> RETURN Nil
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Ignacio Ortiz de Zúñiga
>>>>>>
http://www.xailer.com
>>>>>>
>>>>>>
>>>>>> "Dionisis Divaris" <
sv1fkk@hol.gr> escribió en el mensaje
>>>>>> news:45ebf1b5$[email=
1@news.xailer.com...]
1@news.xailer.com...[/email]
>>>>>>> Hello again Ignacio
>>>>>>> In the above situation may i use the calculated fields, for those
>>>>>>> fields not included in the browser.
>>>>>>>
>>>>>>> Regards
>>>>>>> Dionisis
>>>>>>>
>>>>>>> Ï "Ignacio Ortiz de Zúñiga" <
NoName@xailer.com> Ýãñáøå óôï ìÞíõìá
>>>>>>> news:45ebe7ed$[email=
1@news.xailer.com...]
1@news.xailer.com...[/email]
>>>>>>>> Dionisis,
>>>>>>>>
>>>>>>>>> Is it possible to use the Edit,Insert,Delete and Append
>>>>>>>>> capabilities
>>>>>>>>> of Tdbfbrowse without define all available fields of database. It
>>>>>>>>> is
>>>>>>>>> important because i need to display only the 5 of the 13 fields of
>>>>>>>>> database, but i need to process all of them.
>>>>>>>>
>>>>>>>> Yes of course, but only those 5 fields will be saved automatically,
>>>>>>>> the rest should be done by you on the TBrowse:OnPostEdit event
>>>>>>>>
>>>>>>>>> If tdbfBrowse used like mentioned above i get errors of type
>>>>>>>>> <DataField:PutVar() Type Error >when going to save append or
>>>>>>>>> insert
>>>>>>>>> records.
>>>>>>>>>
>>>>>>>>
>>>>>>>> Send as the error.log. BTW the method PutVar does not exist, but in
>>>>>>>> any case you should use FieldPut() that writes directly to the data
>>>>>>>> field.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> --
>>>>>>>> Ignacio Ortiz de Zúñiga
>>>>>>>>
http://www.xailer.com
>>>>>>>>
>>>>>>>>
>>>>>>>> "Dionisis Divaris" <
sv1fkk@hol.gr> escribió en el mensaje
>>>>>>>> news:[email=
45eaf390@news.xailer.com...]
45eaf390@news.xailer.com...[/email]
>>>>>>>>> Hello Jose , Ignacio
>>>>>>>>>
>>>>>>>>> Is it possible to use the Edit,Insert,Delete and Append
>>>>>>>>> capabilities
>>>>>>>>> of Tdbfbrowse without define all available fields of database. It
>>>>>>>>> is
>>>>>>>>> important because i need to display only the 5 of the 13 fields of
>>>>>>>>> database, but i need to process all of them.
>>>>>>>>>
>>>>>>>>> If tdbfBrowse used like mentioned above i get errors of type
>>>>>>>>> <DataField:PutVar() Type Error >when going to save append or
>>>>>>>>> insert
>>>>>>>>> records.
>>>>>>>>>
>>>>>>>>> Is there any way to overcome this.
>>>>>>>>>
>>>>>>>>> Many Thanks
>>>>>>>>> Dionisis
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
>