Page 1 of 1

Unhandled Exception

Posted: Mon Aug 31, 2015 8:56 am
by drpeteryee
I received this message"Unhandled exception has occurred... Can't find file: "benefit" (errno: 2) when I click on the patient file on the appointment window.

Is this a mysql error? I had copied a few files on back up and that may have caused an error? I am able to log on to open dental and see past patients but when clicking on the patient from appointments the error comes.

If I moved the file from c: to usb E:let me know which file I have to move back and to which directory or subdirectory. Thanks

The details are these:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
MySql.Data.MySqlClient.MySqlException (0x80004005): Can't find file: 'benefit' (errno: 2)
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
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 OpenDentBusiness.DataConnection.GetTable(String command)
at OpenDentBusiness.Db.GetTable(String command)
at OpenDentBusiness.Crud.BenefitCrud.SelectMany(String command)
at OpenDentBusiness.Benefits.Refresh(List`1 listForPat, List`1 subList)
at OpenDental.ContrChart.RefreshModuleData(Int64 patNum, Boolean isFullRefresh)
at OpenDental.ContrChart.ModuleSelected(Int64 patNum, Boolean isFullRefresh)
at OpenDental.ContrChart.ModuleSelectedNewCrop(Int64 patNum)

Re: Unhandled Exception

Posted: Mon Aug 31, 2015 9:44 am
by Arna
Sounds like you have a missing table from your database.
Is this an Open Dental build or self compiled?
You mentioned you moved databases. Are you sure you moved the correct database?

Re: Unhandled Exception

Posted: Mon Aug 31, 2015 10:03 am
by drpeteryee
What file would the tables be located. If I found that on my e: drive where on the c drive should i paste the file or files to.

Re: Unhandled Exception

Posted: Mon Aug 31, 2015 10:25 am
by Arna
That's a tricky question. It can be wherever the my.ini file specifies it to be. http://opendental.com/manual/myini.html. The DataDir entry is the database directory location.
The my.ini is typically located at C:\Program Files\MySQL\MySQL Server 5.5\ and the database is typically found at C:/mysql/data/, however these are easily changed during or after installation.
When working in an unfamiliar environment, I always:
1. Open Computer Management Utility. To do this, right click on My Computer or This PC and select Manage. Choose the Services and Applications Option. Choose Services.
2. Navigate to MySQL service. Right click on the MySQL service and select Properties.
3. Note the path to executable. This is normally C:\Program Files (x86)\MySQL\MySQL Server 5.5\ or C:\Program Files\MySQL\MySQL Server 5.5\.
4. Navigate the to path of the executable.
5. Open the my.ini file My.ini file information for mysql 5.5.
6. The datadir line entry states where the database is located.

Re: Unhandled Exception

Posted: Mon Aug 31, 2015 11:20 am
by drpeteryee
Once the file is found which directory do I drag it into? Or if I copied it to my E:drive where do I place the file into or which directory - my sql, open dent images, etc. Thanks

Re: Unhandled Exception

Posted: Mon Aug 31, 2015 11:31 am
by Arna
Which file are you referring to? The database, or the specific table?

Re: Unhandled Exception

Posted: Mon Aug 31, 2015 1:26 pm
by drpeteryee
Since this error is caused by the tables not being found- what file name will the tables be found and which directory will it it be found since I have a copy of all of this on my E: back up drive

Re: Unhandled Exception

Posted: Mon Aug 31, 2015 1:40 pm
by Arna
It would be best if we could take a look at this with you. Before you attempt to make any changes on your own back up your database. This is highly dangerous and you could wipe out current data if you are not sure what you are doing. I highly recommend that you involve us to screen share and understand what you've done thus far and what you are trying to achieve.
There are three components of the table- benefit.MYD, benefit.from and benefit.MYI. One of these could be missing from your database. It is not always as simple as placing the missing file in the database directory. Open Dental uses primary keys to maintain relationships between the benefit table and other tables. If those keys are missing or overwritten, it could corrupt your database.
Give us a call. We'll take a look.
If this is a test restore, to test the backup, try again. Consider that backup bad.