Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFPOLEDB Bug or ?
Message
From
21/02/2010 10:09:31
 
 
To
20/02/2010 09:35:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01449715
Message ID:
01450118
Views:
53
>>>Yes Gregory,
>>>That is the problem. It works as if it is a date only value.
>>>Cetin
>>>
>>
>>
>>Cetin,
>>
>>To exclude foxpro anomalies, I have tried it with vbs and I can confirm that vbs also loses the time part.
>>
>>
>>
>>We cannot blame it on foxpro. VBS is also wrong
>>Now, if .net works it cannot be VFPOLEDB
>>
>>So, I'm intrigued where it goes wrong. I believe both vfp and vbs pass a VT_DATE
>>
>>
>>WScript.Echo Now()
>>
>>
>>
>>Set loCon = Createobject("AdoDb.Connection")
>>Set loCmd = Createobject("Adodb.Command")
>>
>>loCon.ConnectionString="Provider=VFPOLEDB;Data Source=D:\Project9\Parse\Data\tmp.dbc"
>>
>>loCon.CursorLocation= 3    'adUseClient
>>loCon.Open()
>>loCmd.ActiveConnection=loCon
>>loCmd.CommandText="insert into Test (f1, f2) values (123,?)"
>>
>>Set loParm = loCmd.CreateParameter("f2")
>>
>>loParm.Type = 135 
>>
>>loParm.Value = Now()
>>
>>loCmd.Parameters.Append( loParm )
>>
>>loCmd.Execute()
>>
>>loCon.Close
>>
>
>Thanks for trying in VB. I still blame on foxpro because if I do it against SQL server using SQLOLEDB, SQLNCLI driver the time part is included. It is not how VFP passes it, it is not VFPOLEDB then who is guilyty? Me for sure trying to use it from VFP:)
>Cetin

Cetin,

The datetime value is passed as a double
If you assign eg 123.45 to loParm.Value and then print loParm.Value, you will see a datetime

Where does it go wrong ? Maybe the format of the double - such that adob thinks that the fractional part ( the seconds ) is invalid en hence zero
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform