-
January 29th, 2011, 01:31 AM
#1
CDBException because access file table item have value like "#Error".
Hi all,
i m using access with odbc connection and use CRecordset class,
some time the table item have value like "#Error".and if i want to try read this record than exception is generate here.
please tell me how can i remove this record or tell me anything else to handle this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
-
January 29th, 2011, 04:31 AM
#2
Re: CDBException because access file table item have value like "#Error".
If a CDBException is thrown, means that something gone wrong either in database or in your code.
See CDBException::m_nRetCode for possible error sources.
First of all, you have to handle those exceptions, i.e. try and catch them to see what's going wrong and eventually, take a decision.
Code:
try
{
// call some functions which can throw CDBException*
// (methods of CDatabase, CRecordset and related classes).
}
catch(CDBException* e)
{
e->ReportError(); // show what's going wrong.
// ... something else that has to be done in case of error...
e->Delete(); // delete exception.
}
-
January 29th, 2011, 06:30 AM
#3
Re: CDBException because access file table item have value like "#Error".
Originally Posted by vjshankwar
... some time the table item have value like "#Error".and if i want to try read this record than exception is generate here.
please tell me how can i remove this record or tell me anything else to handle this.
And what is the field type where an item value is like "#Error"?
Is it your own database or a third party one?
Usually "#Error" means that something is wrong with a field or table or database design...
Victor Nijegorodov
-
January 31st, 2011, 11:39 PM
#4
Re: CDBException because access file table item have value like "#Error".
e->ReportError(); gives error message "MFC Internal Error : unable to load error string from resource".
and the field type is Text and its my own access type database.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
-
February 1st, 2011, 02:24 AM
#5
Re: CDBException because access file table item have value like "#Error".
Check the validation rule for this "Text" field, the texts in this field to have correct characters and length (BTW, what is the max allowed length for this field?)Do these texts UNICODE or ANSI?
What happens if you open this DB in Access data view: do you see tses "#Error" values somewhere?
Victor Nijegorodov
-
February 7th, 2011, 01:28 AM
#6
Re: CDBException because access file table item have value like "#Error".
i m not set any max value for field, by default it takes 255 chars.
when i open the access file and the table has value display like #Error and when i select this row or column access file popup the error message "Not a valid bookmark"
please help me how can i do this.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
-
February 7th, 2011, 01:59 AM
#7
Re: CDBException because access file table item have value like "#Error".
You must first of all find out the appearance of "#Error" in this Access table!
Last edited by VictorN; February 7th, 2011 at 05:42 AM.
Victor Nijegorodov
-
February 7th, 2011, 05:33 AM
#8
Re: CDBException because access file table item have value like "#Error".
Originally Posted by VictorN
You must firdt of all to find out the appearance of "#Error" in this Access table!
When I compacted/repaired it I received these errors in a table called MSysCompactError:
-1206 Could not find field 'Description'
-1053 Could not find field 'Description'
in a rep_table
please help me how can i resolve this and prevent to occur this error.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
-
February 7th, 2011, 05:48 AM
#9
Re: CDBException because access file table item have value like "#Error".
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|