Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing SQL-INSERT via ADO is producing incorrect dates
Message
From
30/05/2003 05:25:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
30/05/2003 03:40:17
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00793950
Message ID:
00794401
Views:
24
Practically yes that's the only way I know of when I need to insert a date w/o thinking current set date.
OTOH having set date in 'dbc_BeforeOpenTable' works.
Cetin


Kevin what's wrong with sending strictdate format. It's safe. If you have dates as variables (ie: ldDate1, ldDate2) then something like this would convert to needed format :

'Insert into myTable (...) values (..., {' +;
trans(dtoc(ldDate1,1),'@R ^9999/99/99')+'},...)'


>Thanks Cetin
>
>Is that the only way you know of, it seems quite strange to me as I'm sure I've never had this problem before.
>
>Kev
>
>>>Hi
>>>
>>>When I pass an INSERT-SQL like "INSERT INTO Table (DateField) VALUES ({15/01/2003})" via ADO Connection, VFP always places the date into the table as an American style format.
>>>
>>>I have SET DATE TO British set via the DBC OpenData event, what else can I do?
>>>
>>>Thanks
>>>Kev
>>
>>Kevin,
>>Use strictdate format :
>>"INSERT INTO Table (DateField) VALUES ({^2003/01/15})"
>>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
Reply
Map
View

Click here to load this message in the networking platform