By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,608 Members | 3,801 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,608 IT Pros & Developers. It's quick & easy.

ODBC microsoft access driver

P: n/a
hello all,

im trying to connect to a microsoft access database from an ASP.NET web
form.
i keep getting the following error though:

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not use
'(unknown)'; file already in use. ERROR [IM006] [Microsoft][ODBC Driver
Manager] Driver's SQLSetConnectAttr failed ERROR [HY000]
[Microsoft][ODBC Microsoft Access Driver] Could not use '(unknown)';
file already in use.

i think its something to do with permissions and ive tried changing the
permissions on the folder that the mdb database is in (C:\Documents and
Settings\All Users\Documents), but im still getting an error.ive been
tryin to fix this for the past week but nothing i do seems to work.

any help would be appreciated.

Feb 23 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I quickly learned access if NOT the DB to use for web applications. My
guess here is that you were testing your application and it bombed
somewhere in the middle, you tried it again and got this error right?
Because when your app bombed the first time it left the connection open
and also "locked" the database. You will have to wait several minutes
for the lock to be auto cleared by the server.

Here are a few reasons to NOT use access;
1. The locking issues that you are experiencing
2. Its unstable and easy to corrupt
3. Access has limited concurrent connections. If you have too many
users accessing it you will get errors.

If you can get mysql (there are free versions available) I would use
that. Its way faster than access, you can have many more concurrent
connections, and it's VERY stable. You can get a web interface that
allows you to do almost everything you could do through access, like
view rows, edit rows, delete rows, add columns, etc. I was a die hard
MS Access fan for small web sites myself but when those small websites
started getting a little more popular I started having major database
problems. I also had random problems with locking and tables being
corrupt.

Since I've changed everything over to MYSQL, I have had no problems,
and my sites performance was immediately boosted. I know there are
probably a dozen people that are going to reply back stating otherwise
but the facts don't lie, and my experience with both db's proves MYSQL
is a much better choice.

Jeremy Reid
http://hgtit.com

Feb 23 '06 #2

P: n/a

Access makes sense..in limited areas.

A User database with <100 people.. Sure use Access.

...

Your issues.

You need to have write priv's to both the mdb file and the ldb file. Which
I usually create a /db directory, and give the directory the privs.
Thats why when posting to hosting companies... they usually have a /db
directory that you MUST put your mdb files in.

check
www.connectionstrings.com

you want to use the ODEDBCONNECTION string, not ODBC also.

OLE DB, OleDbConnection (.NET)
a.. Standard security:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User
Id=admin;Password=;"

b.. Workgroup (system database):

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet
OLEDB:System Database=system.mdw;"

c.. With password:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet
OLEDB:Database Password=MyDbPassword;"
...

HOWEVER, you might consider MSDE.

check my blog
http://spaces.msn.com/sholliday/
12/16/2005 entry

...

I don't use Access anymore, since my hosting company is easy on the
budget...with Sql Server.

For small amounts of readonly data, I throw it in an Xml File.. and create a
strongly typed dataset.

For any real db access... I develop against MSDE, and either use it , or the
sql server my hosting company provides.

Its a little more startup time.. but the advantages of a "real" RDBMS over
access become apparently quickly.

...

<so*******@yahoo.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
hello all,

im trying to connect to a microsoft access database from an ASP.NET web
form.
i keep getting the following error though:

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not use
'(unknown)'; file already in use. ERROR [IM006] [Microsoft][ODBC Driver
Manager] Driver's SQLSetConnectAttr failed ERROR [HY000]
[Microsoft][ODBC Microsoft Access Driver] Could not use '(unknown)';
file already in use.

i think its something to do with permissions and ive tried changing the
permissions on the folder that the mdb database is in (C:\Documents and
Settings\All Users\Documents), but im still getting an error.ive been
tryin to fix this for the past week but nothing i do seems to work.

any help would be appreciated.

Feb 23 '06 #3

P: n/a
thanks for that. but, at the risk of sounding stupid, what exactly is a
/db directory?.
thanks for the help.

Feb 24 '06 #4

P: n/a
The /db directory is simply a folder on your site where the permissions
are set for that folder and all its files to allow special access. The
"db" stands for database. You could name it whatever you want, the
important part is that usually that folder has the specific permissions
set. Like 'sloan' descibed above it would be for your MDB and your LDB
files that are associated with MS Access databases.

Is using a database like SQL or mySQL out of the question for your
application?

Jeremy Reid
http://hgtit.com

Feb 24 '06 #5

P: n/a
not really, but im approaching my project deadline and mite be a bit
tough to change over now. Also i have to use ODBC i think...

Mar 3 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more ASP.NET Questions on Bytes