Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - File Alread in Use Error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

File Alread in Use Error

 Post Reply Post Reply
Author
vshriniwasan View Drop Down
Groupie
Groupie
Avatar

Joined: 17 December 2001
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote vshriniwasan Quote  Post ReplyReply Direct Link To This Post Topic: File Alread in Use Error
    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

Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
vshriniwasan View Drop Down
Groupie
Groupie
Avatar

Joined: 17 December 2001
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote vshriniwasan Quote  Post ReplyReply Direct Link To This Post Posted: 06 September 2004 at 7:47am

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

shrini

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.