电脑故障

位置:IT落伍者 >> 电脑故障 >> 浏览文章

ado extentsion绑定recordset冗余变量问题


发布日期:2022/3/19
 

由于绑定操作是由宏实现的ADO EXTENTSION 绑定 recordset时需要注意冗余变量问题 不慎将导致记录无法出来

class CHasPrpRs : public CADORecordBinding

{

BEGIN_ADO_BINDING(CHasPrpRs)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_TenantIndividualID

sizeof(m_ch_TenantIndividualID) m_ul_TenantIndividualIDStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Email

sizeof(m_ch_Email) m_ul_EmailStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_TenantIDNumber

sizeof(m_ch_TenantIDNumber) m_ul_TenantIDNumberStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Name

sizeof( m_ch_Name) m_ul_NameStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Salutation

sizeof( m_ch_Salutation ) m_ul_SalutationStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Country

sizeof( m_ch_Country ) m_ul_CountryStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Phone

sizeof( m_ch_Phone ) m_ul_PhoneStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_CellPhone

sizeof( m_ch_CellPhone ) m_ul_CellPhoneStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Fax

sizeof( m_ch_Fax ) m_ul_FaxStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_PHS

sizeof( m_ch_PHS ) m_ul_PHSStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_MoveInDate

sizeof( m_ch_MoveInDate ) m_ul_MoveInDateStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Company

sizeof( m_ch_Company ) m_ul_CompanyStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Actived

sizeof( m_ch_Actived ) m_ul_Actived true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_MemberID

sizeof( m_ch_MemberID ) m_ul_MemberIDStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Language

sizeof( m_ch_Language ) m_ul_LanguageStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Marriage

sizeof( m_ch_Marriage ) m_ul_MarriageStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Occupation

sizeof( m_ch_Occupation ) m_ul_OccupationStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_newsletter

sizeof( m_ch_newsletter ) m_ul_newsletterStatus true)

ADO_VARIABLE_LENGTH_ENTRY( adVarChar m_ch_Gender

sizeof( m_ch_Gender ) m_ul_GenderStatus true)

END_ADO_BINDING()

public:

//<Point A

TCHAR m_ch_TenantIndividualID[]; //

TCHAR m_ch_Email[]; //

TCHAR m_ch_TenantIDNumber[]; //

TCHAR m_ch_Name[]; //

TCHAR m_ch_Salutation[]; //

TCHAR m_ch_Country[]; //

TCHAR m_ch_Phone[]; //

TCHAR m_ch_CellPhone[]; //

TCHAR m_ch_Fax[]; //

TCHAR m_ch_PHS[]; //

TCHAR m_ch_MoveInDate[];//datetime //

TCHAR m_ch_Company[]; //

TCHAR m_ch_Actived[]; //

TCHAR m_ch_MemberID[]; //

TCHAR m_ch_Language[]; //

TCHAR m_ch_Marriage[]; //

TCHAR m_ch_Occupation[]; //

TCHAR m_ch_newsletter[]; //

TCHAR m_ch_Gender[]; //

//int m_i_TenantIndividualID;

//<Point B

ULONG m_ul_TenantIndividualIDStatus; //

ULONG m_ul_EmailStatus; //

ULONG m_ul_TenantIDNumberStatus; //

ULONG m_ul_NameStatus; //

ULONG m_ul_SalutationStatus; //

ULONG m_ul_CountryStatus; //

ULONG m_ul_PhoneStatus; //

ULONG m_ul_CellPhoneStatus; //

ULONG m_ul_FaxStatus; //

ULONG m_ul_PHSStatus; //

ULONG m_ul_MoveInDateStatus; //datetime //

ULONG m_ul_CompanyStatus; //

ULONG m_ul_Actived ; //

ULONG m_ul_MemberIDStatus; //

ULONG m_ul_LanguageStatus; //

ULONG m_ul_MarriageStatus; //

ULONG m_ul_OccupationStatus; //

ULONG m_ul_newsletterStatus; //

ULONG m_ul_GenderStatus; //

public:

inline void Init()

{

//m_i_TenantIndividualID=;

memset(m_ch_TenantIndividualIDsizeof(m_ch_TenantIndividualID)); //

memset(m_ch_Emailsizeof(m_ch_Email)); //

memset(m_ch_TenantIDNumbersizeof(m_ch_TenantIDNumber)); //

memset(m_ch_Namesizeof(m_ch_Name)); //

memset(m_ch_Salutationsizeof(m_ch_Salutation)); //

memset(m_ch_Countrysizeof(m_ch_Country)); //

memset(m_ch_Phonesizeof(m_ch_Phone)); //

memset(m_ch_CellPhonesizeof(m_ch_CellPhone)); //

memset(m_ch_Faxsizeof(m_ch_Fax)); //

memset(m_ch_PHSsizeof(m_ch_PHS)); //

memset(m_ch_MoveInDatesizeof(m_ch_MoveInDate));//datetime //

memset(m_ch_Companysizeof(m_ch_Company)); //

memset(m_ch_Activedsizeof(m_ch_Actived)); //

memset(m_ch_MemberIDsizeof(m_ch_MemberID)); //

memset(m_ch_Languagesizeof(m_ch_Language)); //

memset(m_ch_Marriagesizeof(m_ch_Marriage)); //

memset(m_ch_Occupationsizeof(m_ch_Occupation)); //

memset(m_ch_newslettersizeof(m_ch_newsletter)); //

memset(m_ch_Gendersizeof(m_ch_Gender)); //

}

CHasPrpRs()

{

Init();

};

virtual ~CHasPrpRs() {};

};如上代码Point A与Point B之间不能出现冗余变量否则有可能导致取不到值或者无法显示

上一篇:MSDN:匿名方法

下一篇:URL的传递字符串问题小研究