insert into Message (msgTime,msg)select msgTime,msg from Message as B in 'c:/test.mdb' where not exists (select * from Message as A where (A.msgTime=B.msgTime))
我想插入test.mdb里的数据,test.mdb是带密码的,密码的字符串应该放在哪里?
我想插入test.mdb里的数据,test.mdb是带密码的,密码的字符串应该放在哪里?
解决方案 »
- 【原创&交流】分享一个开源的批量修改VC工程属性的小工具
- 介绍本学COM,ATL的好书。
- 你们希望下一代Visual C++都具有什么功能?
- 友情提示,长期兼职的朋友进来看下以免上当.
- 如何判断别的进程产生了异常
- 请问各位高手,有没有办法用ADO同时打开两个access数据库,谢谢!!
- ADO如何判断数据库中某个表是否存在??
- 如何取得窗口的状态(SW_SHOW/SW_HIDE)?
- 我要做一个1024×768大小的对话框,直接在资源文件中修改控件的大小,请问vc中的描述控件大小的是什么单位,怎么和像素不一致,应该如何
- 项目遇到Excel,算是疯掉了,找了N种解决方案,都有颈瓶卡住,现罗列出来,大家能帮我解决其中之一就可以了.急啦!!!!!!!!!!!!
- 请问现在正在下载文件,下载到一半,我要暂停,但是要保存刚才下载的,暂停的功能应如何写啊,请高手指点
- 退出程序确认为什么多一个WM_QUERYENDSESSION
return E_FAIL; IADORecordBinding *picRs = NULL;
_RecordsetPtr pRs("ADODB.Recordset");//初始化记录查询
_ConnectionPtr pConn("ADODB.Connection" );//初始化记录连接
_CommandPtr pCmdChange = NULL; CString strSql,chSqlSentence; strSql = strSql +
_T("Provider=Microsoft.Jet.OLEDB.4.0;") +
_T("Data Source = ") +
m_szMdbPath +
_T(";Persist Security Info=False;Jet OLEDB:Database Password=") +
m_lpPass; try
{
pConn->Open((_bstr_t)strSql, "", "", adModeUnknown);//打开数据库
pRs->QueryInterface(
__uuidof(IADORecordBinding), (LPVOID*)&picRs); TESTHR(pCmdChange.CreateInstance(__uuidof(Command)));
pCmdChange->ActiveConnection = pConn;
pCmdChange->CommandText = lpSqlExecute; // Open titles table, casting Connection pointer to an
// IDispatch type so converted to correct type of variant.
TESTHR(pRs.CreateInstance(__uuidof(Recordset)));
pRs->Open ((_variant_t)lpTable, _variant_t((IDispatch *) pConn, true), adOpenStatic, adLockOptimistic, adCmdTable);
// Clear extraneous errors from the Errors collection.
pConn->Errors->Clear(); // Use the Connection object's execute method to
// execute SQL statement to restore data.
pConn->Execute(lpSqlExecute, NULL, adExecuteNoRecords); // Retrieve the current data by requerying the recordset.
pRs->Requery(adCmdUnknown); //pRs->Update();
pRs->Close(); bSuccess = TRUE;
}
catch (...)
{
if ( pRs != NULL )
pRs->Close(); if ( pConn != NULL )
pConn->Close(); pRs = NULL;
pConn = NULL;
return E_FAIL;
} pConn->Close();
return S_OK;
{
BOOL bSuccess = FALSE; if( lpTable == NULL || lpSqlExecute == NULL )
return E_FAIL; IADORecordBinding *picRs = NULL;
_RecordsetPtr pRs("ADODB.Recordset");//初始化记录查询
_ConnectionPtr pConn("ADODB.Connection" );//初始化记录连接
_CommandPtr pCmdChange = NULL; CString strSql,chSqlSentence; strSql = strSql +
_T("Provider=Microsoft.Jet.OLEDB.4.0;") +
_T("Data Source = ") +
m_szMdbPath +
_T(";Persist Security Info=False;Jet OLEDB:Database Password=") +
m_lpPass; try
{
pConn->Open((_bstr_t)strSql, "", "", adModeUnknown);//打开数据库
pRs->QueryInterface(
__uuidof(IADORecordBinding), (LPVOID*)&picRs); TESTHR(pCmdChange.CreateInstance(__uuidof(Command)));
pCmdChange->ActiveConnection = pConn;
pCmdChange->CommandText = lpSqlExecute; // Open titles table, casting Connection pointer to an
// IDispatch type so converted to correct type of variant.
TESTHR(pRs.CreateInstance(__uuidof(Recordset)));
pRs->Open ((_variant_t)lpTable, _variant_t((IDispatch *) pConn, true), adOpenStatic, adLockOptimistic, adCmdTable);
// Clear extraneous errors from the Errors collection.
pConn->Errors->Clear(); // Use the Connection object's execute method to
// execute SQL statement to restore data.
pConn->Execute(lpSqlExecute, NULL, adExecuteNoRecords); // Retrieve the current data by requerying the recordset.
pRs->Requery(adCmdUnknown); //pRs->Update();
pRs->Close(); bSuccess = TRUE;
}
catch (...)
{
if ( pRs != NULL )
pRs->Close(); if ( pConn != NULL )
pConn->Close(); pRs = NULL;
pConn = NULL;
return E_FAIL;
} pConn->Close();
return S_OK;
}
我現在想知道test.mdb有密碼,語句應該怎麼改寫?
两个ACCESS表:
select a.*, b.* from tb as a, [;database=e:\a.mdb;pwd=123].tb as b;