Y
ynduanlian
Unregistered / Unconfirmed
GUEST, unregistred user!
由于AddChildObject的第三个参数必须是指针,所以我用下面的程序增加节点:
ADOQry->SQL->Clear();
ADOQry->SQL->Add("select * from tsm_site "
ADOQry->Open();
while (!(ADOQry->Eof)){
String* PStr;
PStr=new(String);
*PStr=ADOQry->FieldByName("Site_no"->AsString;
Node=TvUnit->Items->AddChildObject(rtNode,ADOQry->FieldByName("Site_Name"->AsString,PStr);
Node->HasChildren=true;
ADOQry->Next();
}
ADOQry->Close();
问题是,我要怎么要才能取出这个节点中的Site_no项?
void __fastcall TForm1::TvUnitExpanding(TObject *Sender, TTreeNode *Node,
bool &AllowExpansion)
{
String StrSql;
TTreeNode* CNode;
StrSql="select * from tsm_site where up_site_no='"
+ (Node->Data*)+"'";
这里始终无法编译通过?
ADOQry->SQL->Clear();
ADOQry->SQL->Add("select * from tsm_site "
ADOQry->Open();
while (!(ADOQry->Eof)){
String* PStr;
PStr=new(String);
*PStr=ADOQry->FieldByName("Site_no"->AsString;
Node=TvUnit->Items->AddChildObject(rtNode,ADOQry->FieldByName("Site_Name"->AsString,PStr);
Node->HasChildren=true;
ADOQry->Next();
}
ADOQry->Close();
问题是,我要怎么要才能取出这个节点中的Site_no项?
void __fastcall TForm1::TvUnitExpanding(TObject *Sender, TTreeNode *Node,
bool &AllowExpansion)
{
String StrSql;
TTreeNode* CNode;
StrSql="select * from tsm_site where up_site_no='"
+ (Node->Data*)+"'";
这里始终无法编译通过?