Thread View: borland.public.cppbuilder.database.multi-tier
1 messages
1 total messages
Started by Mark Vejvoda
Tue, 19 Sep 2000 00:00
YOU CAN'T HANDLE THE TRUTH!!! Locate and Date formats EXPOSED!!!
Author: Mark Vejvoda
Date: Tue, 19 Sep 2000 00:00
Date: Tue, 19 Sep 2000 00:00
20 lines
1487 bytes
1487 bytes
Using locate in C++ Builder can be AGONIZING especially when the user has
some WACKED OUT regional settings like dd-MMM-yy in which LOCATE MERELY
PUKES ON! ShortDateFormat won't help you here either..... the solution.....
Instead of adding the TDateTime variable to your variant array, Pass it as a
formatted date string, but MAKE SURE you set ShortDateFormat to something
you can trust in your constructor like dd'/'mm'/'yyyy then ALSO set
Application->UpdateFormatSettings = false;
Now you can use the code below and it won't care what regional settings the
user swaps too.... VICTORY!!!!
Variant locvalues[3];
locvalues[0] = Variant(iEmpID);
locvalues[1] = Variant(dtExDate.FormatString(ShortDateFormat));
//Variant(dtExDate);
locvalues[2] = Variant(iExID);
bFoundShiftMatch =
cdsEmployeeSchedule->Locate("EmpID;Date;ReliefExceptionID",
VarArrayOf(locvalues, 2), TLocateOptions());
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads