3,245
社区成员
发帖
与我相关
我的任务
分享
::CoInitialize(0);
_Application app;
DoCmd docmd;
if(!app.CreateDispatch("Access.Application"))
{
AfxMessageBox("无法启动Access服务器!");
return;
}
app.SetVisible(false);
app.SetUserControl(false);
app.OpenCurrentDatabase("d:\\t5.mdb",FALSE,"");
//app.SetDisplayAlerts(FALSE);
LPDISPATCH lpDisp = app.GetDoCmd();
docmd.AttachDispatch(lpDisp);
docmd.TransferDatabase(0,COleVariant("Paradox 5.X"),COleVariant("d:\\test"),0,COleVariant("钢筋计算表.db"),COleVariant("m1554"),
COleVariant((short)0),COleVariant((short)0));
docmd.Quit(0);
docmd.DetachDispatch();
app.Quit(0); // 退出_Application
app.ReleaseDispatch (); // 释放_Application
::CoUninitialize();