try
{
COleDateTime odt = COleDateTime::GetCurrentTime();
strSQL.Format("insert into Emc_LinkStudy_Log values(1,TO_DATA('%d-%d-%d %d:%d:%d', 'YYYY-MM-DD HH24:MI:SS'),%s,%s,%s,%d,%s,%s, %6.4f, %d, %d, %d, %s, %s)",
odt.GetYear(),odt.GetMonth(),odt.GetDay(),odt.GetHour(),odt.GetMonth(),odt.GetSecond(),
theApp.m_UserInfo.szUserName,
strTransStationID,
strRecvStationID,
pLinkSaveRecords->PropModelParam.nModeType,
strModeParam,
"接收机参数?",
0.0,
0,
0,
0,
"分析标题",
"注释"
);
//保存log
HRESULT hr = theApp.m_pConnectionDatabase->Execute(_bstr_t(strSQL), NULL, adExecuteNoRecords); //保存数据
for (int i = 0; i < (int)pLinkSaveRecords->vectRecordsData.size(); i++)
{
strSQL.Format("insert into Emc_LinkStudy_Data values(1, %.4f, %.4f, %.4f)",
pLinkSaveRecords->vectRecordsData.at(i).DST,
pLinkSaveRecords->vectRecordsData.at(i).EL,
pLinkSaveRecords->vectRecordsData.at(i).RX_LVL
);
hr= theApp.m_pConnectionDatabase->Execute(_bstr_t(strSQL), NULL, adExecuteNoRecords);
}
}同时对两个表写入数据,第二个可以看到数据,第一个怎么会没有呢,strSQL显示的数据是正确的啊,
{
COleDateTime odt = COleDateTime::GetCurrentTime();
strSQL.Format("insert into Emc_LinkStudy_Log values(1,TO_DATA('%d-%d-%d %d:%d:%d', 'YYYY-MM-DD HH24:MI:SS'),%s,%s,%s,%d,%s,%s, %6.4f, %d, %d, %d, %s, %s)",
odt.GetYear(),odt.GetMonth(),odt.GetDay(),odt.GetHour(),odt.GetMonth(),odt.GetSecond(),
theApp.m_UserInfo.szUserName,
strTransStationID,
strRecvStationID,
pLinkSaveRecords->PropModelParam.nModeType,
strModeParam,
"接收机参数?",
0.0,
0,
0,
0,
"分析标题",
"注释"
);
//保存log
HRESULT hr = theApp.m_pConnectionDatabase->Execute(_bstr_t(strSQL), NULL, adExecuteNoRecords); //保存数据
for (int i = 0; i < (int)pLinkSaveRecords->vectRecordsData.size(); i++)
{
strSQL.Format("insert into Emc_LinkStudy_Data values(1, %.4f, %.4f, %.4f)",
pLinkSaveRecords->vectRecordsData.at(i).DST,
pLinkSaveRecords->vectRecordsData.at(i).EL,
pLinkSaveRecords->vectRecordsData.at(i).RX_LVL
);
hr= theApp.m_pConnectionDatabase->Execute(_bstr_t(strSQL), NULL, adExecuteNoRecords);
}
}同时对两个表写入数据,第二个可以看到数据,第一个怎么会没有呢,strSQL显示的数据是正确的啊,
try
{
COleDateTime odt = COleDateTime::GetCurrentTime();
strSQL.Format("insert into Emc_LinkStudy_Log values(1,TO_DATA('%d-%d-%d %d:%d:%d', 'YYYY-MM-DD HH24:MI:SS'),%s,%s,%s,%d,%s,%s, %6.4f, %d, %d, %d, %s, %s)",
odt.GetYear(),odt.GetMonth(),odt.GetDay(),odt.GetHour(),odt.GetMonth(),odt.GetSecond(),
theApp.m_UserInfo.szUserName,
strTransStationID,
strRecvStationID,
pLinkSaveRecords->PropModelParam.nModeType,
strModeParam,
"接收机参数?",
0.0,
0,
0,
0,
"分析标题",
"注释"
);
//保存log
HRESULT hr = theApp.m_pConnectionDatabase->Execute(_bstr_t(strSQL), NULL, adExecuteNoRecords);//保存数据
for (int i = 0; i < (int)pLinkSaveRecords->vectRecordsData.size(); i++)
{
strSQL.Format("insert into Emc_LinkStudy_Data values(1, %.4f, %.4f, %.4f)",
pLinkSaveRecords->vectRecordsData.at(i).DST,
pLinkSaveRecords->vectRecordsData.at(i).EL,
pLinkSaveRecords->vectRecordsData.at(i).RX_LVL
);
hr=theApp.m_pConnectionDatabase->Execute(_bstr_t(strSQL), NULL, adExecuteNoRecords);
}
}
你再试试