尝试使用delphi 7通过qbfc库连接到quickbooks公司文件。
导入已创建QBFC12Lib_TLB文件的类型库
将文件包含在我的表单的使用列表
中连接库的代码
var
TempSession : QBSessionManager;
TempRequest : IMsgSetRequest;
TempCustomer : ICustomerAdd;
TempResponse : IMsgSetResponse;
AppID, AppName : WideString;
begin
AppID := '123';
AppName := 'Hello';
TempSession.OpenConnection2(AppID, AppName, ctLocalQBDLaunchUI);
TempSession.BeginSession('', omDontCare);
但是“TempSession.OpenConnection2 ....”上发生了访问冲突错误。
有没有人试过这个,或者有人可以提供一些如何做到这一点的样本吗?
答案 0 :(得分:2)
正如Ken White
建议的那样(并且如this SO question所示),您需要在调用QBSessionManager
之前实例化OpenConnection2
对象
QBSessionManager TempSession = new QBSessionManager();
或可能(虽然我找不到任何使用这种表示法的例子)
TempSession := QBSessionManager.Create();