Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO DateTime fields
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00429660
Message ID:
00430297
Views:
16
In SQL:
Col1 Col2
1 10/01/99 12:00:00
2 10/02/99 12:00:00
3 10/03/99 12:00:00
After SQL Select into VFP cursor
Col1 Col2
1 10/01/99 12:00:00
2 10/02/99 12:00:00
3 10/03/99 12:00:00
After CURTORS
Col1 Col2
1 10/17/00 12:00:00
2 10/17/00 12:00:00
3 10/17/00 12:00:00

When I convert the VFP cursor to an ADO recordset, it changes all the fields which were orig. smalldatetime fields in SQL to the current date time.

ie
SQLE(1,"Select Col1,Col2 from Test","curTest")
oADO = CreateObject('vfpcom.comutil')
oRS = CreateObject('ADODB.RECORDSET')
oADO.CURSORTORS(oRS)
oRs.MoveFirst
?oRs.Fields(0).value && prints "Col1"
?oRS.Fields(1).value && prints the current date (10/17/00 12:00:00) should print 10/01/99 12:00:00
oRs.MoveNext
?oRS.Fields(1).value && prints the current date (10/17/00 12:00:00) should print 10/02/00 12:00:00


>I still don't entirely understand the issue. I do notice that you are using smalldatetime. I have found that if you stray beyond char, varchar, bit, datetime, int, dec - essentially, the basic data types, you can run into problems in VFP. Again, I don't understand what is "wrong". Are you encountering an error. Is the data getting munged up? What exactly is the problem? What exactly is wrong?
>
>One suggestion would be be is to use the basic datetime type in SQL...
>
>Other than that, you will need to give me more detailed info...
>
>< JVP >
>
>
>>The current date is being entered in place of the date in the field. This data is comming from a SQL 7 database using SQLE(...). The orig datatype is smalldatetime. This only happens when I get a result set from SQL, VFP tables with a DateTime field seem to work ok. I can't really go straight to ADO from SQL since I need to do some touching up and join in some VFP lookup data before passing the ADO rs on.
>>
>>Bill
>>
>>>Hi Bill..
>>>
>>>When you say the DateTime Fields are wrong, what do you mean by "wrong"?
>>>
>>>Unless one knows what is wrong, one cannot know the issue...< bg >...
>>>
>>>< JVP >
>>>
>>>
>>>>I am creating Crystal Reports for my web site now. Whenever I use cur2rs to convert my cursor to ado to pass to the CR report, all the DateTime fields are wrong. Is this a know issue? Is there a work around? Now I do a second query with a TTOD() on any datetime fields.
>>>>
>>>>TIA
>>>>Bill
Bill Mittenzwey
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform