Connection Problem

P

Paul Smith

I have established a connection to an Access DB on my hard drive, well at
least I think I have because a) the connection tested okay and b) when I
double click on a table in the Server Explorer window, the contents of the
table appears correctly.

However I am having a problem using that connection in my VB.net
application.

My Error:

The Microsoft Jet database engine cannot open the file 'C:\Documents and
Settings\PWS\My Documents\NewCDLData.mdb'. It is already opened exclusively
by another user, or you need permission to view its data.

I am following code from a book:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.load

OldDBDataAdapter1.Fill(DataSet1)

DataGrid1.DataSource = DataSet1

DataGrid1.DataBind()

End Sub

If it hels the Build fails on the First line of the procedure.

I realise this must be something simple as I have followed the instructions
froma book, but what is it??????
 
K

Kevin Spencer

This exception can be thrown if, for example, you have the database opened
in Access while running your ASP.net app.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Expect the unaccepted.
 
P

Paul Smith

Please...... I should have said that nothing else is open other than the
Visual Studio .Net.
 
W

WJ

Paul Smith said:
Please...... I should have said that nothing else is open other than the
Visual Studio .Net.

1. Make sure you run the latest MDAC (I am using 2.8)
2. Grant proper privillege to the "very account" that runs the application
(real time) on all Access files.
3. Try to relocate your "NewCDLData.mdb" file to other location than
'C:\Documents and
Settings\PWS\My Documents\" folder. Reasons: a) You do not inadvertently
give wrong permisson to someone else. 2) If your OS needs to be rebuilt with
data to be preserved, your data will not be erased by the rebuild process.
Because this folder is a special folder and is always initialized by the O.S
being reinstalled.

John
 

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

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top