.NETGURU
Using Access with C#.NET
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.odbcnet.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Curt Emich
I'm tyring to use MS Access with .NET, but I'm having some problems. Here's
the code:

string sSQL = "SELECT Statement_Id,Statement_In_Brief FROM Statements";

OleDbDataAdapter thisAdapter = new OleDbDataAdapter(sSQL,oleDbConnection1);

DataSet thisDataset = new DataSet();

thisAdapter.Fill(thisDataset,"Statements");

It bombs on the 4th line. I get the error message, "

The Microsoft Jet database engine cannot open the file
'C:\Inetpub\wwwroot\TrainOfThought\data\TrainOfThought.mdb'. It is already
opened exclusively by another user, or you need permission to view its data.
It is not opened by another user, etc. Something else is going on. Does
anyone have any ideas as to what that might be? Thanks in advance for your
help.

Reply to this message...
 
    
William Ryan eMVP (VIP)
can you open it manually?
"Curt Emich" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
> I'm tyring to use MS Access with .NET, but I'm having some problems.
Here's
[Original message clipped]

Reply to this message...
 
    
Paul Clement
On Wed, 17 Mar 2004 18:33:17 -0500, "Curt Emich" <Click here to reveal e-mail address> wrote:

¤ I'm tyring to use MS Access with .NET, but I'm having some problems. Here's
¤ the code:
¤
¤
¤
¤ string sSQL = "SELECT Statement_Id,Statement_In_Brief FROM Statements";
¤
¤ OleDbDataAdapter thisAdapter = new OleDbDataAdapter(sSQL,oleDbConnection1);
¤
¤ DataSet thisDataset = new DataSet();
¤
¤ thisAdapter.Fill(thisDataset,"Statements");
¤
¤
¤
¤ It bombs on the 4th line. I get the error message, "
¤
¤ The Microsoft Jet database engine cannot open the file
¤ 'C:\Inetpub\wwwroot\TrainOfThought\data\TrainOfThought.mdb'. It is already
¤ opened exclusively by another user, or you need permission to view its data.
¤ It is not opened by another user, etc. Something else is going on. Does
¤ anyone have any ideas as to what that might be? Thanks in advance for your
¤ help.

Very likely a permissions issue. Make certain that you have Read, Write, Create, and Modify
permissions to the folder where the database is located.

If this is web app you will probably need to provide these permissions to the ASPNET account,
although it will also depend upon what type of authentication you are using for your ASP.NET
application.

Paul ~~~ Click here to reveal e-mail address
Microsoft MVP (Visual Basic)
Reply to this message...
 
    
Scotty C.
This error is usually caused by the actual *.mdb file not having the correct permissions. You must make sure that the asp.net user and the <machinename>_IUSER user is added to the security list from the properties of the file.

----- Curt Emich wrote: -----

I'm tyring to use MS Access with .NET, but I'm having some problems. Here's
the code:

string sSQL = "SELECT Statement_Id,Statement_In_Brief FROM Statements";

OleDbDataAdapter thisAdapter = new OleDbDataAdapter(sSQL,oleDbConnection1);

DataSet thisDataset = new DataSet();

thisAdapter.Fill(thisDataset,"Statements");

It bombs on the 4th line. I get the error message, "

The Microsoft Jet database engine cannot open the file
'C:\Inetpub\wwwroot\TrainOfThought\data\TrainOfThought.mdb'. It is already
opened exclusively by another user, or you need permission to view its data.
It is not opened by another user, etc. Something else is going on. Does
anyone have any ideas as to what that might be? Thanks in advance for your
help.

Reply to this message...
 
 
System.Data.DataSet
System.Data.OleDb.OleDbDataAdapter




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification