Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 20th, 2007, 07:02 PM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 124
Thanks: 0
Thanked 1 Time in 1 Post
Default Can't open the database; VS.net 2002/Framework 1.0

After running DataGrid control and Binding control with an Access database successfully, I tried to run a Windows application on another Access database. This WinForm did show up; however, the first record was missing and all the database buttons didn't work.

Later on I tried to run a WebForm (aspx) application with the second databse. Simiarly, a 'can not open the file' error msg showed up. I checked my database security properties, my user name was permitted to access the database. The error msg displayed the reason for the error: It is already opened exclusively by another user, or you need permission to view its data.

Questions:
1. How do I know if the database is already opened by another user?
2. The coding I used was from a 2004 VB.net book. Is it possible that the VS.net 2002 does not support this source codes:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArg:
 'Put User Code to initializa the page her
 Me.OleDbDataAdapter1.Fill(Me.DataSet11.Employees)
 Me.DataBind()

TIA,
Jeffrey
__________________
C. Jeffrey Wang
 
Old March 20th, 2007, 09:20 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

The error in question normally occurs in one of 2 secnarios: (note: I am basing this off of past ASP experience and not .NET as I have never tried to connect to Access from .NET)

1. Someone has opened the file directly in access and has caused windows to Lock the Database; while Access is open and running this database, your application will not be able to use it.
2. You have opened a connection to the database somewhere and have not closed it hence all subsequent calls cause this error to be thrown.

The code that you provided above should work just fine.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old March 21st, 2007, 12:57 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Jeffrey,

Your user account probably has nothing to do with it; it's usually the ASPNET or Network Service account that you need to configure. Take a look here:
http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=263

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old March 21st, 2007, 10:28 PM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 124
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thank you very much. I have solved the problem.
 
Old March 22nd, 2007, 01:51 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

For the benefit of the archive of this forum, would you mind telling us how you solved it?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old March 22nd, 2007, 05:51 PM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 124
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Imar,

I opened the link in your email and followed the instruction to set up an database read and write permission for my VB.net account. That's it.

Thanks again,
Jeffrey
 
Old March 22nd, 2007, 05:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Great. Thanks for the follow up....

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
DAT File Extension open in DotNet Framework bala2 General .NET 0 August 27th, 2007 08:30 AM
Visual Studio .NET 2003 with .NET 2 Framework testsubject VS.NET 2002/2003 1 July 27th, 2006 03:25 PM
Class templates VS.Net 2002 vs. VS.NET 2003 boksi General .NET 4 May 4th, 2005 11:58 AM
Querying an Access Database from FrontPage 2002 eclipse66 Classic ASP Databases 0 April 7th, 2005 11:31 PM
Is .NET framework req. to install .NET application tact_259 VS.NET 2002/2003 2 May 20th, 2004 08:20 PM





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