.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘database’

ACC2000: References Not Imported with Objects from Another Database

Symptoms
When you import a Microsoft Access object from one database into anotherdatabase, any reference used by the object is not imported, and you mustre-create the reference in the target database. For example, if you insertan ActiveX control on a form, Microsoft Access automatically creates areference to the .ocx file for that control. If you then open anotherdatabase and import the form that contains the ActiveX control from thefirst database, the reference to the .ocx file is not imported with theform. This behavior also occurs when you export an object.
Resolution
A reference is not imported or exported with an object because it is notspecific to the object; instead, a reference is specific to the project ofa database.

ACC2000: “Object Invalid or No Longer Set” Error with CurrentDb

Symptoms
When you refer to properties and methods belonging to objects created withthe CurrentDb function, you may receive the following error message:

Object invalid or no longer set.
Resolution
When you set an object variable, such as a TableDef object, which requiresa reference to a database object, your code refers directly to theCurrentDb function instead of referring to a database object variable thatyou set with the CurrentDb function.

ACC2000: “Can’t Open the Table” in Data Source of ASP File Error

Symptoms
When you try to open a Microsoft Access table in Design view, you mayreceive the following message:

You can’t open the table ‘<tablename>’ for modification.
A query or form bound to the table is open, you may not have permissionto open this table in Design view, or another user has the table open.Do you want to open this table as read-only?
If you have opened a query or form bound to this table, close it, andthen try again to open the table in Design view.You may also receive errors if you try to move or copy a database inWindows Explorer; for example you may receive the message:

Cannot move <database>: There has been a sharing violation.
The source or destination file may be in use.
-or-

Cannot rename <database name>: Access is denied.
Make sure the disk is not full or write-protected and that the file isnot currently in use.
Resolution
The database is an ODBC data source that is used by an ASP file. Forexample, this behavior would occur if the table itself, or a query or formbased on that table, had been exported to ASP format. Although the ASPfile, itself, may not currently be open in a user’s browser, the Session object for a particular user session persists for the period of time specified by its Timeout property. The ASP file contains code that creates a Connection object and stores that connection in the session variable. Therefore, the connection to the Microsoft Access database that serves as the ODBC data source persists until the session times out. The default value of the Timeout property is 20 minutes.