Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Bug in OLEDB ?

This is driving us crazy. It appears that when we use OLE
to open a csv in Excel, all dates are being interpreted as
US format, despite the regional settings being set to UK.
If we open the csv manually then all is fine. Someone has
suggested that this is a bug and the solution is to go
back to using DDE, but I cannot find any information about
it. Can somebody please confirm one way or the other and
maybe offer a solution ? We are using VB6.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Bug in OLEDB ?

Ric,

In int'l environments you'll need to avoid the CSV driver like the plague
CSV is a pesky and VERY badly written converter.

When you rename the .csv file to .txt, and THEN open it you have far more
control.


If you program for Excel XP+ only have a look at the workbooks.OpenTEXT
method.

You can also force a standard text open and then use the TextToColumn
wizard dialog.

I'm no longer a frequent visitor to the ng, pls email if questions
adres below


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Ric" wrote:

This is driving us crazy. It appears that when we use OLE
to open a csv in Excel, all dates are being interpreted as
US format, despite the regional settings being set to UK.
If we open the csv manually then all is fine. Someone has
suggested that this is a bug and the solution is to go
back to using DDE, but I cannot find any information about
it. Can somebody please confirm one way or the other and
maybe offer a solution ? We are using VB6.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Bug in OLEDB ?

"Ric" wrote ...

when we use OLE
to open a csv in Excel, all dates are being interpreted as
US format, despite the regional settings being set to UK.


Are you using a Schema.ini file, knowingly or otherwise (look in your
csv file's folder)? You probably should be using one to explicitly
specify columns' data types because it sounds like your dates are
being imported as text. Take a look at:

Working with Text Files
http://msdn.microsoft.com/library/de...htextfiles.asp

"A Schema.ini file is ... recommended when your text file contains
Date/Time, Currency, or numeric floating-point data, or any time you
want more control over handling the data in the text file."

This article, despite the cringe-worthy pun, could also be useful:

Much ADO About Text Files
http://msdn.microsoft.com/library/de...ng03092004.asp

Someone has
suggested that this is a bug and the solution is to go
back to using DDE


To employ the analogy of aeroplanes (that's 'airplanes' to
non-residents), if ADO is a jet engine (not to be confused with the
Jet SQL engine) then DDE is a turbo prop and should be consigned to
history, although there are a lot of planes out there still using them
(perhaps I should've said 'elastic band' except they are useful for
other things). So ignore your ground crew and keep full steam ahead
with your OLE DB proto plane.

--
  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Bug in OLEDB ?

Thanks for the pointer. I'm now using the OpenText method.
The weird thing is that it ignores my date formatting
unless I explicitly set the formatting for every column.
Oh well, at least it works now.

Ric.
-----Original Message-----
Ric,

In int'l environments you'll need to avoid the CSV driver

like the plague
CSV is a pesky and VERY badly written converter.

When you rename the .csv file to .txt, and THEN open it

you have far more
control.


If you program for Excel XP+ only have a look at the

workbooks.OpenTEXT
method.

You can also force a standard text open and then use the

TextToColumn
wizard dialog.

I'm no longer a frequent visitor to the ng, pls email if

questions
adres below


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Ric" wrote:

This is driving us crazy. It appears that when we use

OLE
to open a csv in Excel, all dates are being interpreted

as
US format, despite the regional settings being set to

UK.
If we open the csv manually then all is fine. Someone

has
suggested that this is a bug and the solution is to go
back to using DDE, but I cannot find any information

about
it. Can somebody please confirm one way or the other

and
maybe offer a solution ? We are using VB6.


.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Bug in OLEDB ?


If you and your users use xlXP+ only,
have a look at the LAST argument (Local) in the OpenText Method.
(it's undocumented.. but it seems to do the trick!)

Experiment with macrorecorder...


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


wrote:

Thanks for the pointer. I'm now using the OpenText method.
The weird thing is that it ignores my date formatting
unless I explicitly set the formatting for every column.
Oh well, at least it works now.

Ric.
-----Original Message-----
Ric,

In int'l environments you'll need to avoid the CSV driver

like the plague
CSV is a pesky and VERY badly written converter.

When you rename the .csv file to .txt, and THEN open it

you have far more
control.


If you program for Excel XP+ only have a look at the

workbooks.OpenTEXT
method.

You can also force a standard text open and then use the

TextToColumn
wizard dialog.

I'm no longer a frequent visitor to the ng, pls email if

questions
adres below


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Ric" wrote:

This is driving us crazy. It appears that when we use

OLE
to open a csv in Excel, all dates are being interpreted

as
US format, despite the regional settings being set to

UK.
If we open the csv manually then all is fine. Someone

has
suggested that this is a bug and the solution is to go
back to using DDE, but I cannot find any information

about
it. Can somebody please confirm one way or the other

and
maybe offer a solution ? We are using VB6.


.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft.ACE.OLEDB.12.0 - BUG Sven Pran Excel Discussion (Misc queries) 0 July 8th 08 06:42 PM
Using OleDB to get data from Excel dvd00 Excel Discussion (Misc queries) 1 November 30th 04 04:32 PM
EXCEL AND OLEDB Yama Excel Programming 4 February 25th 04 03:29 PM
Excel schema using Jet OLEDB Provider? mike Excel Programming 1 December 22nd 03 09:25 AM
OleDB returning DBNull for numeric cells Paul Excel Programming 0 December 4th 03 05:48 PM


All times are GMT +1. The time now is 09:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"