People Posted February 28, 2004 Posted February 28, 2004 Hi, I'm a newbee in vb.net I want to display a datagrid on a webform I make a connection with a access database using a dataset. If i use it in a windows form then it works perfect, but if i want to run the same on a webform the following error ocures: Server Error in '/test' Application. -------------------------------------------------------------------------------- De Microsoft Jet-database-engine kan het bestand C:\Inetpub\wwwroot\Test\mdb\FormesGryspa.mdb niet openen. Het is exclusief geopend door een andere gebruiker of u hebt een machtiging nodig om de gegevens te kunnen bekijken. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: De Microsoft Jet-database-engine kan het bestand C:\Inetpub\wwwroot\Test\mdb\FormesGryspa.mdb niet openen. Het is exclusief geopend door een andere gebruiker of u hebt een machtiging nodig om de gegevens te kunnen bekijken. Source Error: Line 130: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Line 131: 'Put user code to initialize the page here Line 132: OleDbDataAdapter1.Fill(DsFormes1) Line 133: DataGrid1.DataBind() Line 134: End Sub Source File: c:\inetpub\wwwroot\Test\WebForm1.aspx.vb Line: 132 Stack Trace: [OleDbException (0x80004005): De Microsoft Jet-database-engine kan het bestand C:\Inetpub\wwwroot\Test\mdb\FormesGryspa.mdb niet openen. Het is exclusief geopend door een andere gebruiker of u hebt een machtiging nodig om de gegevens te kunnen bekijken.] System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) System.Data.OleDb.OleDbConnection.InitializeProvider() System.Data.OleDb.OleDbConnection.Open() System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) Test.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\Test\WebForm1.aspx.vb:132 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain() Thanks Quote
Moderators Robby Posted February 28, 2004 Moderators Posted February 28, 2004 Kind of hard to help you without seeing the code, my guess is that you need this before the DataBind() line... DataGrid.DataSource= DsFormes1 Quote Visit...Bassic Software
People Posted February 29, 2004 Author Posted February 29, 2004 Hi, Proberly i think there is a security problem. The error tells me that the jet-engine not can be opened because he is opened by another user or i have not the access permissions. a copy of my code: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load DsFormes1.Clear() OleDbDataAdapter1.Fill(DsFormes1) DataGrid1.DataSource = DsFormes1 DataGrid1().DataBind() End Sub Thanks for yhe help Quote
Moderators Robby Posted February 29, 2004 Moderators Posted February 29, 2004 Is there an open connection from a previous object? Quote Visit...Bassic Software
People Posted March 1, 2004 Author Posted March 1, 2004 No, there is no other or previous connection with the database. Its strange because its works perfect on a windows form. I have put the mode = shary deny none into my code but the problems are not changed. Is it normal that my mdb folders location(c:\inetpub\wwwroot...) is different as my webform, and my webform open in my browser on Localhost... Thanks for reply Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.