ODBC microsoft access driver

S

somersbar

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.
 
B

blackstaronline.net

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
 
S

sloan

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.

...
 
S

somersbar

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

blackstaronline.net

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
 
S

somersbar

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...
 

fyz

Joined
Apr 26, 2008
Messages
1
Reaction score
0
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...
Hi,

I think you need to check your mdb file cause I have similar problems and my mdb file is corrupt. Unfortunately, I don't have a backup. So I searched on net and tried a utility called Advanced Access Repair to repair my Access MDB file. It works rather well but not free. So I think you should backup the database in time.
 
Joined
May 29, 2008
Messages
1
Reaction score
0
This error comes in case of database corruption. It seems your database get corrupted, repair it with using compact and repair utility. If it is critically corrupted then you can use access repair software. I have been faced same problem before and repaired it with this software.
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top