Functions in Access to which data in SQL Server is copied
- 2020-04-01 21:27:08
- OfStack
The initial idea was to use two recordsets, one to fetch data from SQL and one to insert data into Access
Because the table has more fields, we have to use a loop
Because the table has more fields, we have to use a loop
while (!m_pRecordset_sql->adoEOF)
{
m_pRecordset_access->AddNew();
for (int i = 0; i < m_pRecordset_sql->Fields->Count; i++)
{
vValue = m_pRecordset_sql->GetCollect(_variant_t((long)i));
m_pRecordset_access->PutCollect(_variant_t((long)i), vValue);
}
m_pRecordset_access->Update();
m_pRecordset_sql->MoveNext();
}