Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting date into sql or firebird;What is .t. value in
Message
From
08/10/2005 03:45:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
07/10/2005 21:48:35
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01050571
Message ID:
01057401
Views:
8
>the fbdtos (and the other) function doesnt work too...
>doesnt those function just convert to a string with the format '2005/01/01' or
>'2005-01-01'..?
>as i've pointed out earlier i've tried all sort of string format for the date and none works..i'm beginning to think that the problem may be with odbc, or firebird or the VFP version (version5) that i'm using? But isnt it if i use sql pass-thorough it shouldnt matter what version of VFP im using since i just pass the command to the back-end? How does the firebird documentation say about this? it's odd that while firebird is free, the documentation is not and its so very very scarce..and the issue i have with the date is such a simple one. just the date format. i've successfully connected to firebird and successfully inserted records into it from within VFP as long as i dont insert date values..so the problem is really how firebird wants to accept the date..

What is the 'other function'? Formatting date as string? You can try ODBC canonical format that every backend is supposed to recognize: YYYY/MM/DD hh:mm:ss.
However note that again I never suggested to convert to a string and pass that. I suggest the simple and right way to do it:
ldDate = {^2005/1/15} && this is VFP date - VFP knows that you mean Jan 15, 2005
* and makes necessary conversions for you to send to backend
SQLExec(m.lnHandle, 'select * from myTable where dateField = ?m.ldDate','resultCursor')
Have you tried this?
For ADO the date string formatting is different. Formatting as a string is open to errors. OTOH if you use parametric approach as shown above you always know what you're sending.
Yes VFP version doesn't matter (Dates work since VFP3 as far as I know - I don't remember fox2x connectivity kit). I don't know anything about FB documentation and I don't use FB. This is a general ODBC thing and FB should be no exception.
Have you checked aerror() result when it fails? Maybe it's failing for another thing and you're thinking it's date passing that fails. You say you're doing insertions. Are you doing insertions to the same table? Does your date field on FB accept nulls (should be if that's the same table and you're inserting records w/o sending date)? Does your date field have some constraint checking? Anyway check aerror() result.
PS: SSE is also free. http://lab.msdn.microsoft.com/express/sql
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform