שתף באמצעות


Could Not Find File C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\database].mdb

Question

Sunday, December 9, 2012 9:02 PM

As of the moment VS 2010 won't let me open most of my forms in Design view. The only one that will open is my base form that the other forms use for inheritance.

It doesn't make sense to me that the db file needs to be located in the IDE folder, but even when I copy it to there the error doesn't go away.

When I build/rebuild the solution or debug everything runs flawlessly which is another reason why I can't understand why this is happening. 

Below are the call stack, and code from my ..dataset.designer.vb & baseform.vb files.

Call stack:

at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at VBAutoCenterSystem.VBAutoDataSetTableAdapters.VehicleTableAdapter.Fill(VehicleDataTable dataTable) in S:\..DataSet.Designer.vb:line 2495
at VBAutoCenterSystem.VBBaseForm.VBVehicleForm_Load(Object sender, EventArgs e) in S:\..BaseForm.vb:line 52
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Form.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Design.DesignerFrame.Initialize(Control view)
at System.Windows.Forms.Design.DocumentDesigner.Initialize(IComponent component)
at System.Windows.Forms.Design.FormDocumentDesigner.Initialize(IComponent component)
at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
at System.ComponentModel.Design.DesignerHost.PerformAdd(IComponent component, String name)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload) 

DataSet.Designer.vb:

2486        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
2487         Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"),  _
2488         Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"),  _
2489         Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)>  _
2490        Public Overloads Overridable Function Fill(ByVal dataTable As VBAutoDataSet.VehicleDataTable) As Integer
2491            Me.Adapter.SelectCommand = Me.CommandCollection(0)
2492            If (Me.ClearBeforeFill = true) Then
2493                dataTable.Clear
2494            End If
2495            Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
2496            Return returnValue
2497        End Function

BaseForm.vb:

49    Private Sub...Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
50
51        'TODO: This line of code loads data into the 'DataSet.table' table. You can move, or remove it, as needed.
52        VBVehicleForm.VehicleTableAdapter.Fill(...Form.DataSet.table)
53    End Sub

All assistance is greatly appreciated.

All replies (4)

Monday, December 10, 2012 10:08 AM ✅Answered

I assume you have messed something up in the Dataset

Click on that in the Solution Explorer and when you have it in view, right click on it and choose Config or Reconfig.

Success
Cor


Wednesday, December 19, 2012 1:54 AM ✅Answered

Its been almost 2 weeks since I got it figured out. Basically I removed the database completely, disconnected the controls from it, and removed all references. Then just re-added via the wizard again and all is well. Thank you for the replies.


Tuesday, December 11, 2012 5:37 AM

HI JRobida,

Welcome to the MSDN forum.

>>When I build/rebuild the solution or debug everything runs flawlessly which is another reason why I can't understand why this is happening. 

According your post, you used the datasource wizard to connect with database.

The exception will not be removed automatically when you add the database file back. You need to re-compile it to check whether this action works.  That’s why the no exception occur when rebuild it.

If you want to change the location of the database file, here are two ways:

1. Add the file to the specific folder you want and do the datasource wizard again (remove all old controls and code)

2. Edit the path of connection string in App.config file directly (open it with VS or notepad).

Hope this helps.

Mark Liu-lxf
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Tuesday, December 18, 2012 9:22 AM

HI JRobida,

We haven’t heard from you for several days. I’d like to mark the helpful replies as answers firstly. If you have any additional questions, you also can unmark the reply and post your question here. 

Sorry for any inconvenience and have a nice day.

Mark Liu-lxf
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.