Print Page | Close Window

File Alread in Use Error

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=11705
Printed Date: 28 March 2026 at 9:09pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: File Alread in Use Error
Posted By: vshriniwasan
Subject: File Alread in Use Error
Date Posted: 06 September 2004 at 1:25am

I am running the following code to fill a dataset and I am getting file in use error. I have restarted, cleared my cache. What might be the problem. Can't think... 1 AM...

Thanks in advance,

Shrini

 

Code:

Dim strSQL As String = "Execute " & spName 'Stored Procedure
Dim myConn1 as New OleDbConnection(AccessConnString)
Dim oda As New OleDBDataAdapter(strSQL, myConn1)
Dim ds As New DataSet

Try
 oda.Fill(ds, dsName) <--Line21
 Return ds 'Return the DataSet
Catch e As Exception
 lblError.Text = e.ToString
Finally
 If Not oda Is Nothing Then oda.Dispose()
 If Not ds Is Nothing Then ds.Dispose()
End Try

Error:

System.Data.OleDb.OleDbException: Could not use ''; file already in use. at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at System.Data.OleDb.OleDbConnection.InitializeProvider() at System.Data.OleDb.OleDbConnection.Open() at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) at System.Data.Common.DbDataAdapter.FillFromCommand(Object 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, String srcTable) at ASP.DesktopDefault_aspx.GetSingleSelect(String DbType, String spName, String dsName) in line 21




Replies:
Posted By: pmormr
Date Posted: 06 September 2004 at 3:00am
sounds like you're already using the database... first make sure the database is not physically open on your computer or on anybody elses and then if it still doesn't work look for a shadow copy of the database (it's hidden (the file attribute) in the same folder that the database's in) and delete it... that should solve your problem

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: vshriniwasan
Date Posted: 06 September 2004 at 7:47am

Sorry no....Checked both of them already.... Any other items.... Is the code correct?

shrini




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net