//--------------------------------------------------------------------------- void __fastcall TServerModeDemoDataDM::AddRecords(int ACount, TdxProgressEvent AProgress) { int ASubCount = 10; String ASQL; ADConnection->StartTransaction(); try { for (int I=0;I<(ACount/ASubCount);I++) { if ((I % 100) == 0) AProgress(this, I*ASubCount*100.0/ACount); ASQL = ""; for (int J=1;J<=ASubCount;J++) { ASQL = ASQL + GetInsertSQL(); } ADConnection->ExecSQL(ASQL); } ADConnection->Commit(); } __except(EXCEPTION_EXECUTE_HANDLER) { ADConnection->Rollback(); } }
void PanoramaViewData::SaveData( int nAirportID ) { CString strSQL; if( GetID() < 0) { GetInsertSQL(nAirportID,strSQL); m_nID = CADODatabase::ExecuteSQLStatementAndReturnScopeID(strSQL); }else { GetUpdateSQL(strSQL); CADODatabase::ExecuteSQLStatement(strSQL); } }
void IntersectItem::SaveData( int nParentID ) { if( GetUID() >=0 ) { CString strSQL; GetUpdateSQL(strSQL); CADODatabase::ExecuteSQLStatement(strSQL); } else // insert data { CString strSQL; GetInsertSQL(nParentID, strSQL); m_nUID = CADODatabase::ExecuteSQLStatementAndReturnScopeID(strSQL); } }
void CPaxBusParking::SaveData(int nParentID) { m_nPathID = CADODatabase::SavePath2008IntoDatabase(m_path); CString strSQL; if (m_nID < 0) { GetInsertSQL(nParentID,strSQL); if (strSQL.IsEmpty()) return; m_nID = CADODatabase::ExecuteSQLStatementAndReturnScopeID(strSQL); } else { GetUpdateSQL(strSQL); if (strSQL.IsEmpty()) return; CADODatabase::ExecuteSQLStatement(strSQL); } }
void IntersectedStretch::SaveData( int nParentID ) { CString strSQL; if (m_nID < 0) { GetInsertSQL(nParentID,strSQL); if (strSQL.IsEmpty()) return; m_nID = CADODatabase::ExecuteSQLStatementAndReturnScopeID(strSQL); } else { GetUpdateSQL(strSQL); if (strSQL.IsEmpty()) return; CADODatabase::ExecuteSQLStatement(strSQL); } }