Text driver issue with opened files

C

Chris C.

There doesn't seem to be a proper forum for this question. I first looked at
an ADO.NET forum, where a sticky post referred the kind of question I have to
a SQL server forum, and when I asked there I was told to ask here. It has
nothing to do with Access directly, but ODBC calls from a native C++ app,
using the Microsoft Text Driver. It seemed to be a reasonable way to read a
set of CSV files.

When I do a SELECT on table/file that someone else has open in a text editor
(or possibly Excel) I get:

[Microsoft][ODBC Microsoft Text Driver] The Microsoft Jet database engine
cannot open the file '(unknown)'. It is already opened exclusively by another
user, or you need permission to view its data.

Is there some possible way to open files concurrently using this method? I
will not be updating them with ODBC; they're only being read. So far the only
workaround that seems to work is to set the "readonly" flag on all the files.
This is not terribly onerous since no one should be updating them anyway, but
I'd prefer to not have to rely on that.
 
T

Tom van Stiphout

On Wed, 11 Nov 2009 20:57:01 -0800, Chris C.

That may be a good workaround. There are two problems here: you can't
control how ODBC wants to open your text file, and it may well want to
open it exclusively (not knowing you won't be writing). The other is
you can't control how other apps have opened this file.
So barring just trowing up an error message "file is in use", the
readonly attribute looks very attractive.

-Tom.
Microsoft Access MVP
 
D

Daryl S

Since you don't want to change the files you are reading, you could also copy
them to a different location, open them from there, and delete them when you
are done.

--
Daryl S


Tom van Stiphout said:
On Wed, 11 Nov 2009 20:57:01 -0800, Chris C.

That may be a good workaround. There are two problems here: you can't
control how ODBC wants to open your text file, and it may well want to
open it exclusively (not knowing you won't be writing). The other is
you can't control how other apps have opened this file.
So barring just trowing up an error message "file is in use", the
readonly attribute looks very attractive.

-Tom.
Microsoft Access MVP

There doesn't seem to be a proper forum for this question. I first looked at
an ADO.NET forum, where a sticky post referred the kind of question I have to
a SQL server forum, and when I asked there I was told to ask here. It has
nothing to do with Access directly, but ODBC calls from a native C++ app,
using the Microsoft Text Driver. It seemed to be a reasonable way to read a
set of CSV files.

When I do a SELECT on table/file that someone else has open in a text editor
(or possibly Excel) I get:

[Microsoft][ODBC Microsoft Text Driver] The Microsoft Jet database engine
cannot open the file '(unknown)'. It is already opened exclusively by another
user, or you need permission to view its data.

Is there some possible way to open files concurrently using this method? I
will not be updating them with ODBC; they're only being read. So far the only
workaround that seems to work is to set the "readonly" flag on all the files.
This is not terribly onerous since no one should be updating them anyway, but
I'd prefer to not have to rely on that.
.
 
J

Jack Leach

Can you copy a file that's in use?

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)



Daryl S said:
Since you don't want to change the files you are reading, you could also copy
them to a different location, open them from there, and delete them when you
are done.

--
Daryl S


Tom van Stiphout said:
On Wed, 11 Nov 2009 20:57:01 -0800, Chris C.

That may be a good workaround. There are two problems here: you can't
control how ODBC wants to open your text file, and it may well want to
open it exclusively (not knowing you won't be writing). The other is
you can't control how other apps have opened this file.
So barring just trowing up an error message "file is in use", the
readonly attribute looks very attractive.

-Tom.
Microsoft Access MVP

There doesn't seem to be a proper forum for this question. I first looked at
an ADO.NET forum, where a sticky post referred the kind of question I have to
a SQL server forum, and when I asked there I was told to ask here. It has
nothing to do with Access directly, but ODBC calls from a native C++ app,
using the Microsoft Text Driver. It seemed to be a reasonable way to read a
set of CSV files.

When I do a SELECT on table/file that someone else has open in a text editor
(or possibly Excel) I get:

[Microsoft][ODBC Microsoft Text Driver] The Microsoft Jet database engine
cannot open the file '(unknown)'. It is already opened exclusively by another
user, or you need permission to view its data.

Is there some possible way to open files concurrently using this method? I
will not be updating them with ODBC; they're only being read. So far the only
workaround that seems to work is to set the "readonly" flag on all the files.
This is not terribly onerous since no one should be updating them anyway, but
I'd prefer to not have to rely on that.
.
 
T

Tom van Stiphout

On Thu, 12 Nov 2009 10:22:16 -0800, Jack Leach <dymondjack at hot mail
dot com> wrote:

That depends on how it was opened by other apps. If exclusively then
no, but many apps open files shared.

-Tom.
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top