Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Identity fields & RFX

Author  Topic 

cclittle
Starting Member

1 Post

Posted - 2009-04-13 : 14:29:59
Hello,

My database skills are a bit rusty, so please be charitable if this is a dumb question...

We have an identity column in our SQL Server 2008 SP1 database that is giving us exceptions when trying to update records ("Degree of derived table does not match column list"). If we comment out the RFX for this field, everything is fine... which would normally be ok... but we do want to actually read this value so we can use it in other places.

As near as I can tell, there is no way to tell the DoFieldExchange to only read the value but not try to write it.

I've tried Googling on all keyword combos that I can think of, but can't find anyone else having this situation.

Any ideas?

Here is the code - the identity field is "af_id":

void Dbm_AF_RecordSet::DoFieldExchange( CFieldExchange *pFX )
{
//{{AFX_FIELD_MAP(Dbm_AF_RecordSet)
pFX->SetFieldType(CFieldExchange::outputColumn);

RFX_Int(pFX, "AF_ID", mAF.mId );
RFX_Text(pFX, "AF_AIRLINE_ALPHA", mAF.mAirlineAlpha );
RFX_Text(pFX, "AF_FL_NUMBER", mAF.mFlightNumber );
RFX_Date(pFX, "AF_ORIGINAL_TIME", mAF.mOriginalTime );
//}}AFX_FIELD_MAP
}

With DoDataExchange for dialog boxes, there is at least a way to tell which direction the data is going and act accordingly, but there doesn't seem to be a similar directional indicator for databases... unless I'm missing something?

Thanks!
   

- Advertisement -