Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFPOLEDB Bug or ?
Message
De
21/02/2010 10:09:31
 
 
À
20/02/2010 09:35:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01449715
Message ID:
01450118
Vues:
54
>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform