CRecordset::Update
Sylko Olzscher -- so@sidata.com
Tuesday, February 25, 1997
Environment: MSVC 4.0, Windows95, NT 3.51
Hi,
I have a problem with the CRecordset::Update().
Here is the code:
BOOL MySet::Put( const CString& id )
{
Edit();
m_Id = id;
m_Name = _T( "default" );
if ( CanUpdate())
{
TRY
{
Update();
}
CATCH( CDBException, e )
{
theLogger.Add( e->m_strError, TGEM::fatal, __LINE__, __FILE__ );
return FALSE;
}
END_CATCH
return TRUE;
}
Here is the problem:
The first call of the function returns sucessfull (and is sucessfull
indeed). After the second call (with a correct id) I get the following
exception message:
First-chance exception in Frzg.exe (ODBCCR32.DLL): 0xE06D7363: Microsoft
C++ Exception.
Invalid cursor name
State:34000,Native:0,Origin:[Microsoft][ODBC Cursor Library]
Anyone having an idea what's going wrong here, please help.
----------------------------------------------------------------------------
-
Sylko Olzscher
sidata GmbH http://sidata.com email: so@sidata.com
Guerickeweg 5, D-64291 Darmstadt phone: (06151)930-437
----------------------------------------------------------------------------
-
SOECC01.NUEBEL01 -- SOECC01.NUEBEL01@ssw.alcoa.com
Wednesday, February 26, 1997
[Mini-digest: 2 responses]
Try calling UpdateCancel() in your exception handler, to reset the recordset
buffer.
-- Markus
============================================================================
Markus Nuebel | voice: +49 +2921 970-354
ALCOA Automotive Structures GmbH |
Overweg 24 | e-Mail: SOECC01.NUEBEL01@SSW.ALCOA.COM
59471 Soest , Germany | fax: +49 +2921 970-499
============================================================================
_______________________________________________________________________________
Betreff:CRecordset::Update
Von:mfc-l@netcom.com bei ~AMSCCSSW
Datum:26.02.1997 3:25 Uhr
Environment: MSVC 4.0, Windows95, NT 3.51
Hi,
I have a problem with the CRecordset::Update().
Here is the code:
BOOL MySet::Put( const CString& id )
{
Edit();
m_Id = id;
m_Name = _T( "default" );
if ( CanUpdate())
{
TRY
{
Update();
}
CATCH( CDBException, e )
{
theLogger.Add( e->m_strError, TGEM::fatal, __LINE__,
__FILE__ );
return FALSE;
}
END_CATCH
return TRUE;
}
Here is the problem:
The first call of the function returns sucessfull (and is sucessfull
indeed). After the second call (with a correct id) I get the following
exception message:
First-chance exception in Frzg.exe (ODBCCR32.DLL): 0xE06D7363: Microsoft
C++ Exception.
Invalid cursor name
State:34000,Native:0,Origin:[Microsoft][ODBC Cursor Library]
Anyone having an idea what's going wrong here, please help.
----------------------------------------------------------------------------
-
Sylko Olzscher
sidata GmbH http://sidata.com email: so@sidata.com
Guerickeweg 5, D-64291 Darmstadt phone: (06151)930-437
----------------------------------------------------------------------------
-
-----From: Mario Contestabile
>Edit();
>m_Id = id;
>m_Name = _T( "default" );
>if ( CanUpdate())
Shouldn't Edit() be in a try{} block, and be called only if CanUpdate()
returns true?
Eg:
if(CanUpdate()){
try{
Edit();
...
Update();
}
catch(...){}
}
Mario
David Little -- dlittle@equinoxcorp.com
Tuesday, February 25, 1997
You might want to call Requery() to update your cursor. If you are already doing that, I am clueless...
----------
From: Sylko Olzscher[SMTP:so@sidata.com]
Sent: Tuesday, February 25, 1997 7:43 AM
To: mfc-l@netcom.com
Subject: CRecordset::Update
Environment: MSVC 4.0, Windows95, NT 3.51
Hi,
I have a problem with the CRecordset::Update().
Here is the code:
BOOL MySet::Put( const CString& id )
{
Edit();
m_Id = id;
m_Name = _T( "default" );
if ( CanUpdate())
{
TRY
{
Update();
}
CATCH( CDBException, e )
{
theLogger.Add( e->m_strError, TGEM::fatal, __LINE__, __FILE__ );
return FALSE;
}
END_CATCH
return TRUE;
}
Here is the problem:
The first call of the function returns sucessfull (and is sucessfull
indeed). After the second call (with a correct id) I get the following
exception message:
First-chance exception in Frzg.exe (ODBCCR32.DLL): 0xE06D7363: Microsoft
C++ Exception.
Invalid cursor name
State:34000,Native:0,Origin:[Microsoft][ODBC Cursor Library]
Anyone having an idea what's going wrong here, please help.
----------------------------------------------------------------------------
-
Sylko Olzscher
sidata GmbH http://sidata.com email: so@sidata.com
Guerickeweg 5, D-64291 Darmstadt phone: (06151)930-437
----------------------------------------------------------------------------
-
Ajay K Sanghi -- sanghi@giasdl01.vsnl.net.in
Wednesday, February 26, 1997
[Mini-digest: 2 responses]
Hi!,
I am aware of such problems caused by CRecordset::Update().
These are the couple of things that you can try .
1. Try changing the field name of your table . The names that you have
given can very well be some keywords or reserved words which may be
causing the problem . You have given field names as ID & NAME , try and
change these field names.
2. One more problem with quite a few ODBC drivers (e.g Paradox) is that
they dont let you update the table if it is not indexed . Make sure that
the table is indexed on some field .
On Tue, 25 Feb 1997, Sylko Olzscher wrote:
> Environment: MSVC 4.0, Windows95, NT 3.51
>
> Hi,
>
> I have a problem with the CRecordset::Update().
>
> Here is the code:
>
> BOOL MySet::Put( const CString& id )
> {
> Edit();
> m_Id = id;
> m_Name = _T( "default" );
> if ( CanUpdate())
> {
> TRY
> {
> Update();
> }
> CATCH( CDBException, e )
> {
> theLogger.Add( e->m_strError, TGEM::fatal, __LINE__, __FILE__ );
> return FALSE;
> }
> END_CATCH
>
> return TRUE;
> }
>
> Here is the problem:
>
> The first call of the function returns sucessfull (and is sucessfull
> indeed). After the second call (with a correct id) I get the following
> exception message:
>
> First-chance exception in Frzg.exe (ODBCCR32.DLL): 0xE06D7363: Microsoft
> C++ Exception.
> Invalid cursor name
> State:34000,Native:0,Origin:[Microsoft][ODBC Cursor Library]
>
> Anyone having an idea what's going wrong here, please help.
>
> ----------------------------------------------------------------------------
> -
> Sylko Olzscher
> sidata GmbH http://sidata.com email: so@sidata.com
> Guerickeweg 5, D-64291 Darmstadt phone: (06151)930-437
> ----------------------------------------------------------------------------
> -
>
>
-----From: ying.gao@pyxs.com
Try to use CRecordSet::Move before calling MySet::Put(), if you are
trying to update a set of records instead of one record.
If you are trying to update one record continuesly, then why not
get the final data and update to database once. Thus your code will
be more efficient.
-ingrid
>> Environment: MSVC 4.0, Windows95, NT 3.51
>> Hi,
>> I have a problem with the CRecordset::Update().
>> Here is the code:
>> BOOL MySet::Put( const CString& id )
>> {
>> Edit();
>> m_Id = id;
>> m_Name = _T( "default" );
>> if ( CanUpdate())
>> {
>> TRY
>> {
>> Update();
>> }
>> CATCH( CDBException, e )
>> {
>> theLogger.Add( e->m_strError, TGEM::fatal, >>
__LINE__,
>> __FILE__ );
>> return FALSE;
>> }
>> END_CATCH
>>
>> return TRUE;
>> }
>> Here is the problem:
>> The first call of the function returns sucessfull (and is sucessfull
>> indeed). After the second call (with a correct id) I get the following
>> exception message:
>> First-chance exception in Frzg.exe (ODBCCR32.DLL): 0xE06D7363: Microsoft
>> C++ Exception.
>> Invalid cursor name
>> State:34000,Native:0,Origin:[Microsoft][ODBC Cursor Library]
>> Anyone having an idea what's going wrong here, please help.
Kostya Sebov -- sebov@is.kiev.ua
Thursday, February 27, 1997
Hi Sylko,
It was quite long ago so I cannot guarantee the information is 100% correct but it may give you some hints.
I think I had this problem when I tried to update the _filtered snapshot_ obtained from the MS Access (mdb) database.
Sorry I don't remember the version (I told you that was so long ago). The only thing I can say is that it was the last 16-bit
version released (2.0 ?).
I fought with the problem until I was told by my colleague that the MS Access (of that version) could not change filtered snapshots.
The options were either not to use filter (manually searching for the records in questions) or switch to the dynasets. I chose the later
one. This solution had an extra advantage -- the efficiency. The only doubt I had is that my ODBC app now had stricter requirements
on the underlying DBMS (not many ODBC drivers -- at that time --supported dynasets).
HTH and sorry again for the imprecise information.
Kostya Sebov.
----------------------------------------------------------------------------
Tel: +(38 044) 266-6387 /work/, +(38 044) 513-2591 /home/
mailto: sebov@is.kiev.ua
---------------------------------------------------------------------------
Leading programmer
Intelligent Systems (Boston-Kiev)
voice/fax: +(38 044)266-6195
mailto: company@is.kiev.ua
http://www.i-rip.com
----------
From: Sylko Olzscher
Sent: Tuesday, February 25, 1997 15:43
To: mfc-l@netcom.com
Subject: CRecordset::Update
Environment: MSVC 4.0, Windows95, NT 3.51
Hi,
I have a problem with the CRecordset::Update().
Here is the code:
BOOL MySet::Put( const CString& id )
{
Edit();
m_Id = id;
m_Name = _T( "default" );
if ( CanUpdate())
{
TRY
{
Update();
}
CATCH( CDBException, e )
{
theLogger.Add( e->m_strError, TGEM::fatal, __LINE__, __FILE__ );
return FALSE;
}
END_CATCH
return TRUE;
}
Here is the problem:
The first call of the function returns sucessfull (and is sucessfull
indeed). After the second call (with a correct id) I get the following
exception message:
First-chance exception in Frzg.exe (ODBCCR32.DLL): 0xE06D7363: Microsoft
C++ Exception.
Invalid cursor name
State:34000,Native:0,Origin:[Microsoft][ODBC Cursor Library]
Anyone having an idea what's going wrong here, please help.
----------------------------------------------------------------------------
-
Sylko Olzscher
sidata GmbH http://sidata.com email: so@sidata.com
Guerickeweg 5, D-64291 Darmstadt phone: (06151)930-437
----------------------------------------------------------------------------
-
Become an MFC-L member
| Вернуться в корень Архива
|