|
定义 HRESULT hr = NOERROR;
IDBInitialize *pIDBInitialize = NULL;
IDBCreateCommand *pIDBCrtCmd = NULL;
ICommandText *pICmdText = NULL;
IDBProperties *pIDBProperties = NULL;
DBPROP dbprop[1];
DBPROPSET dbpropset[1];
释放 SysFreeString(dbprop[0].vValue.bstrVal);
VariantClear(&dbprop[0].vValue);
if(pICmdText)
{
pICmdText->Release();
}
if(pIDBCrtCmd)
{
pIDBCrtCmd->Release();
}
if(pIDBInitialize)
{
pIDBInitialize->Release();
}
if (pIDBProperties)
{
pIDBProperties->Release();
}
调用Execute
hr = pICmdText->Execute(NULL, IID_NULL, NULL, NULL, NULL);
if(FAILED(hr))
{
// AfxMessageBox(L"添加失败",MB_OK);
goto Exit;
}
我都是看着微软的例子做的. |
|