Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Format a field after opened a remote cursor
Message
From
23/12/2008 06:33:03
 
 
To
23/12/2008 05:42:20
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01369305
Message ID:
01369316
Views:
7
>>>>>Hi All,
>>>>>
>>>>>I want to change type or display format any field of cursor opened with sqlexec command. I want to do after open cursor. Is that possible?
>>>>
>>>>Sure, nothing impossible :-)
>>>>but what type of field, how do you want to display it, where you want to display it?
>>>
>>>I want to convert datetime fields to date. I can do that with cursoradapter and remote views but cannot do with sqlexec.
>>
>>You can't do that with SPT, but you have two choices:
>>1. Create your own TextBox class which will show that datetime field as date (only date portion of it).
>
>First one sounds me a better solution. Thank you...
>

Metin, you risk losing a lot of time.

VFP cannot do this with some ControlSource,Format setting and user readwrite interaction.


>>2. Do something like this:
>>
>>SQLEXEC(....,"tmpCursor")
>>lcSelect = "SELECT "
>>FOR lnFor = 1 TO FCOUNT()
>>    IF TYPE("tmpCursor."+FIELDS(lnFor)) == [T]
>>       lcSelect = lcSelect + "CAST(" + FIELDS(lnFor)+" AS D) AS " + FIELDS(lnFor) + ", "
>>    ELSE
>>       lcSelect = lcSelect + FIELDS(lnFor)+","
>>    ENDIF
>>NEXT
>>lcSelect = LEFT(lcSelect, LEN(lcSelect) - 1)+" FROM tmpCursor INTO RealCursorName READWRITE"
>>&lcSelect
>>
>>Both were on top onn my head and maybe there are other solution which are better than these.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform