将一个ULONG 变量添加到integer 型address_jjczlzn 字段中,语句如下:
m_pRecordset->PutCollect("address_jjczlzn",_variant_t(uLength));
提示:
error C2440: 'type cast' : cannot convert from 'unsigned long' to 'class _variant_t'
若将ulength改为long 型编译通过,但每次执行到
m_pRecordset->PutCollect("address_jjczlzn",_variant_t(uLength));
语句时都错误,跳到异常中。如何将long型和ulong 型变量添加到integer型字段中???
代码如下:
pConn.CreateInstance(__uuidof(Connection));
pConn->Mode=adModeReadWrite;
.........;
pConn->Open(conn,"","",adModeUnknown);
m_pRecordset.CreateInstance(__uuidof(Recordset));
m_pRecordset->CursorLocation=adUseClient;
m_pRecordset->Open.......
pConn->Execute("ALTER TABLE ccic_c_bdcldjb ADD Address_Jjczlzn INTEGER",NULL,adCmdText );
........
m_pRecordset->PutCollect("address_jjczlzn",_variant_t(uLength));
m_pRecordset->PutCollect("address_jjczlzn",_variant_t(uLength));
提示:
error C2440: 'type cast' : cannot convert from 'unsigned long' to 'class _variant_t'
若将ulength改为long 型编译通过,但每次执行到
m_pRecordset->PutCollect("address_jjczlzn",_variant_t(uLength));
语句时都错误,跳到异常中。如何将long型和ulong 型变量添加到integer型字段中???
代码如下:
pConn.CreateInstance(__uuidof(Connection));
pConn->Mode=adModeReadWrite;
.........;
pConn->Open(conn,"","",adModeUnknown);
m_pRecordset.CreateInstance(__uuidof(Recordset));
m_pRecordset->CursorLocation=adUseClient;
m_pRecordset->Open.......
pConn->Execute("ALTER TABLE ccic_c_bdcldjb ADD Address_Jjczlzn INTEGER",NULL,adCmdText );
........
m_pRecordset->PutCollect("address_jjczlzn",_variant_t(uLength));
Address_Jjczlzn
但uLength 只能定义为 long 不能是ulong ,我是用这个字段来表示记录的起始地址的
希望是ulong型的,如何处理????