Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 2nd, 2006, 06:01 AM
Authorized User
 
Join Date: Jan 2006
Location: Hunza, Gilgit, Northern Areas, Pakistan.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hunzian78@yahoo.com
Default The Microsoft Jet database engine cannot open .mdb

Hi All....

Well I got the worst ever tricky problem....

I want to insert a value in my access database through the asp.net application. But i get the following error message:

System.Data.OleDb.OleDbException: The Microsoft Jet database engine cannot open the file 'C:\database\db1.mdb'. It is already opened exclusively by another user, or you need permission to view its data. at System.Data.OleDb.OleDbConnection.ProcessResults(I nt32 hr) at System.Data.OleDb.OleDbConnection.InitializeProvid er() at System.Data.OleDb.OleDbConnection.Open() at test.WebForm2.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\test\webform2.aspx.cs:line 114

Well I have already given permission to IUSER_machinename account so that i would be able to insert values into, but not successfull. This problem occurs when I create the connection using the wizard in visual studio .net. C Drive is formatted using NTFS.

But i am not facing this problem when i create the connection by my own. Also I am not facing this problem when i give the path of database on D Drive that is formattted usng FAT32.

Actually the problem is with the NTFS and the lock file of Access Database. Whenever i try to open the connection, the lock file of access database stops to open at runtime. Instead of releasing the lock file from the database folder it remains there when i close the visual studio.


Pleae try to understand the whole scenario and also use your iq....

Tahnks in advance for your valuable reply....


Abdul Ghaffar

  #2 (permalink)  
Old June 2nd, 2006, 06:07 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Abdul Ghaffar,

IUSR is not used by ASP.NET (under normal circumstances).

Refer to these two FAQs for more information and use your iq... ;)

http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=263
http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=287

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old June 6th, 2006, 12:21 AM
Authorized User
 
Join Date: Jan 2006
Location: Hunza, Gilgit, Northern Areas, Pakistan.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hunzian78@yahoo.com
Default

Thanks IMAR ....

Well for the fist time about 3 months back you answered the same question, at that time I was able to find out the solution by reading your articles but not at this time.

I tried using <identity impersonate="true" /> for IUSR_GHAFFAR. But not successful and I faced this problem System.Data.OleDb.OleDbException: Unspecified error while debugging.

I will appreciate you for your valuable reply....

Abdul Ghaffar



Note: I have already given permission to IUSR_GHAFFAR and for the database folder aswell. I got my IQ stucked :)

  #4 (permalink)  
Old June 6th, 2006, 12:54 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Did you try the ASPNET or Network Service account instead of IUSR?

And are you sure this is a permission error at all? "Unspecified error while debugging." sounds like something else, although I don't know what....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #5 (permalink)  
Old June 10th, 2006, 02:26 AM
Authorized User
 
Join Date: Jan 2006
Location: Hunza, Gilgit, Northern Areas, Pakistan.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hunzian78@yahoo.com
Default


Hi...thanks for your valuable reply.....

Well i face this problem when i connect to the database that is on my c drive (formated witn NTFS) but not on d drive (formatted with FAT32).

The code just runs fine when i only change the source of the database to d drive...(connectioned through the wizards connection string of VS)

Well...here is also an important point when I give permissions to every one on the database on D drive then the code just runs fine but not for ASPNET, IUSR_GHAFFAR....

Sorry I don't know about Network Service Account..... and I didn't tried.....I will be pretty happpy to know a little about that....


Thanks again in advance for your precious reply

Abdul Ghaffar

  #6 (permalink)  
Old June 10th, 2006, 02:41 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi again,

You may want to reread the first article I linked to; it explains that the solutions mentioned work for NTFS only. Fat and FAT32 don't have a security mechanism, so you can't configure security for them. In fact, you won't have the problem in the first place because there can't be a security restriction.

So, I am a bit surprised you can "give permissions to everyone" on a FAT32 drive....

You may also want to reread the second article I linked to. It explains the various accounts (IUSR, ASPNET and Network Service) and when, and on what OS they are used. Basically, if you have ASP.NET on XP, use ASPNET. If you run it on Server 2003: use Network Service.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #7 (permalink)  
Old June 16th, 2006, 12:38 AM
Authorized User
 
Join Date: Jan 2006
Location: Hunza, Gilgit, Northern Areas, Pakistan.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hunzian78@yahoo.com
Default

Hi IMAR ....

Well Thanks Again for Your Valuable Reply...

It was a mistake in writing the C drive instead of D drive to give the database folder on C drive the permission.

Well I tried every thing but I am not successfull...

Once again thanks ....

Abdul Ghaffar


  #8 (permalink)  
Old June 16th, 2006, 01:14 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

And did you try the Network Service account this time?

Can you describe step by step what you did? That way, we may be able to see an error in those steps somewhere....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #9 (permalink)  
Old June 20th, 2006, 05:19 AM
Authorized User
 
Join Date: Jan 2006
Location: Hunza, Gilgit, Northern Areas, Pakistan.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hunzian78@yahoo.com
Default


FINALLY I AM SUCCESSFULL ....

Hi RESPECTED IMAR ... thanks for your valuable replies ...

Well I tried with ASPNET, IUSR_GHAFFAR, NETWORK SERVICE, Users[GHAFFAR\Users] accounts....

But neither Network Service nor IUSR_GHAFFAR account worked, although I already had given permissions to write
into the database's folder.

I tried using Users[GHAFFAR\Users] account, It worked without needing the CHECK BOX [INHERIT FROM PARENT THE PERMISSIONS ...] in the database folder's security tab's advanced button to be enabled.
{Right Click On myDatabase folder->Properties->Security Tab -> Advanced Button -> Check Box(inherit from parent)}

I GAVE PERMISSIONS TO ASPNET ACCOUNT TO WRITE INTO THE FOLDER...FOR THE FIRST TIME IT DIDN'T WORKED BECAUSE THE CHECK BOX [ INHERIT FROM PARENT THE....] WAS NOT CHECKED. BUT WHEN I ENABLED THIS CHECK BOX then it WORKED...

In short for writing into a folder we need to either use ASPNET or Users[ComputerName\users] (may be other accounts aswell) accounts,
and for ASPNET account we need some extra work i.e. to enable the above mentioned check which I didn't before.


Once again thanks IMAR ... i am hoping to become a programmer just like you ....:)

Abdul Ghaffar

  #10 (permalink)  
Old February 1st, 2007, 12:05 PM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I 've trying to get data from excel sheet. the Programs works well in the development server but it doesn't in production server. but I'm sure It's not PERMISSION

My CODE

        Try
            Dim con As String
            Dim _Dataset As New DataSet
            Dim x As Integer
            Dim Data As New DataTable
            If Ruta <> "" Then
                Dim com As New OleDbDataAdapter
                con = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + Ruta + ";Extended Properties=Excel 8.0;"

                If Not com Is Nothing Then
                    com = New OleDbDataAdapter("select * from [sheet1$]", con)
                Else
                    Label1.Text = "nada"
                End If

                Label1.Text = "Antes del FILL"
                com.Fill(_Dataset) 'Here the application goes down!!!
                Label1.Text = "Después del FILL"
                Data = _Dataset.Tables(0)

                dgdMatrizRol.DataSource = _Dataset.Tables(0)
                dgdMatrizRol.DataBind()
            End If
        Catch ex As Exception
            Dim _msg As String
            _msg = "m:" + ex.Message
            _msg = _msg + " s: " + ex.Source
            _msg = _msg + " t: " + ex.StackTrace.ToString
            Label2.Text = _msg

        End Try


The error Message

m:Unspecified error
s: Microsoft JET Database Engine
t: at System.Data.OleDb.OleDbConnection.ProcessResults(I nt32 hr) at System.Data.OleDb.OleDbConnection.InitializeProvid er() at System.Data.OleDb.OleDbConnection.Open() at System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection, ConnectionState& originalState) at System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at Prueba.WebForm1.CargarDatosExcel(String Ruta) in C:\PROYECTOS\ERP\Prueba\WebForm1.aspx.vb:line 103





 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft JET Database Engine (0x80040E07) gwalker_ne8 Classic ASP Databases 2 November 11th, 2006 09:32 AM
Microsoft Jet Database Engine Cannot Open hunzian78@yahoo.com ADO.NET 3 February 23rd, 2006 01:40 PM
NEW: Microsoft JET Database Engine error'80040e14' rishinicolai Classic ASP Databases 4 December 13th, 2005 05:58 AM
Microsoft JET Database Engine (0x80004005) kenh BOOK: Beginning ASP 3.0 4 April 6th, 2005 08:52 AM
Microsoft JET Database Engine (0x80040E14) HaverkPJ Classic ASP Databases 2 November 16th, 2004 11:25 PM



All times are GMT -4. The time now is 01:08 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.