Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DateTime Fields in Grids
Message
 
To
20/10/2003 11:32:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00840269
Message ID:
00854102
Views:
22
(this thread was named correctly for my question so I'm hijacking it for my own question..)

I'm at my wit's end with datetime values and grids.

I'm working with SQL Server data and attempting to use the crippled cursoradapters in VFP 8 for some simple forms.

I've read most everything I can find on here that has DATETIME in the message, and have at least managed to make a textbox based class that will display and allow edit of a date w/o a time. Handles NULL dates too. That part is wonderful (thanks to various folks who suggested unbinding the control and using refresh event to display what I want). It works as long as it is not in a grid.

In a grid, all bets are off. I've been tearing my hair out trying to (1) just display a NULL datetime in a standard textbox in a grid as a blank or something other than .NULL. (no luck at all with NULLDISPLAY property), or (2) actually display just the date using my datebox class that works fine by itself (doesn't work in a grid).

A nice simple date display like 01/01/1980 that has been a staple of the planet for many years!

I'd put up with just shrinking a datetime column to show just the date in a column if I could get it to not display .NULL. on a null date. NULLDISPLAY has had no effect on the display that I can tell.

I'd circumvent the problem if I could send a real SQL command to the server (CONVERT (char(11),datevalue,101)) but apparently the SELECTCMD in the cursoradapter builder doesn't handle SQL Server commands.

In this thread the suggestion is to suck data into a properly formatted second cursor each time you need to work with it. If I had to do that once or twice to hack through a program to get around VFP's shortcomings I could live with it. The system I'm working on lives for dates!

I kept thinking that VFP 8 must have some capability to handle SQL Server data cleanly as I've been working on this project. Someone please prove me right before I have to rewrite in a more capable language!! Help!!
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform