我需要用VC++提取SQL中的点云坐标,请问怎么实现?VC++与SQL的连接已经完成了!点的坐标是3坐标的,点的数量较大,请问要怎么实现?提取出来后如果需要保存为TXT文件的话是不是可以!void CChildView::Onex() 
{
// TODO: Add your command handler code here
_ConnectionPtr m_pConnection;
_variant_t RecordsAffected;
_RecordsetPtr l_pRecordset,lRrd_KPoints,m_pRecordset,m_Num,m_PtArry[10]; //创建与数据库的连接
if(FAILED(m_pConnection.CreateInstance("ADODB.Connection")))
{
AfxMessageBox("create the Instance failed!");
return;
}
if(FAILED(m_pConnection->Open("driver={SQL Server};Server=MS-716FE4FDF85B;DATABASE=hofen;UID=hofen;PWD=hofen","","",adModeUnknown)))///连接数据库)
{
AfxMessageBox("can not open the database!");
m_pConnection.Release();
return;
}

    try
{
l_pRecordset=m_pConnection->Execute("select  xh,x,y,z,k_xh from T_TEMP  order by xh ",&RecordsAffected,adCmdText);

}
catch(...)
{
m_pConnection->Close();
m_pConnection.Release();
AfxMessageBox("m_pConnection->Execute(select  Error!");
return;
}//上面的是创建的与数据库的连接!