E
emoth
Unregistered / Unconfirmed
GUEST, unregistred user!
兄弟我在用KADAO数据引擎(基于DAO)做数据库开发时,每次在程序调试阶段,一启动到某代码时,就提示“Eolesyserror 中的类别未授权使用”,但原来开发时却没有出现过此类问题。请问是什么意思。
程序运行环境为XP SP2,随时打补丁。
KAODAO的出错语句为:
TempDBEngine := CreateOleDBEngine_II(V35);
CreateOleDBEngine_II函数代码如下:
Function TKADaoDatabase.CreateOleDBEngine_II(const ClassName: string): IDispatch;
Const
DBEngine_TGUID: TGUID = '{00000021-0000-0010-8000-00AA006D2EA4}';
Var
LicenseClass : IClassFactory2;
DWReserved : DWORD;
LicenseString : Widestring;
ClassID : TGUID;
Begin
ClassID := ProgIDToClassID(ClassName);
//****************************************************************************
LicenseClass := Nil;
OleCheck(CoGetClassObject(ClassID,CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER, nil, IClassFactory2, LicenseClass));
if Assigned(LicenseClass) Then
Begin
SetLength(LicenseString,2000);
DWReserved:=0;
if F_RuntimeLicense <> '' Then
LicenseString := F_RuntimeLicense
Else
LicenseClass.RequestLicKey(DWReserved,LicenseString);
OleCheck(LicenseClass.CreateInstanceLic (nil, nil, DBEngine_TGUID, LicenseString, Result));
End;
//****************************************************************************
End;
程序运行环境为XP SP2,随时打补丁。
KAODAO的出错语句为:
TempDBEngine := CreateOleDBEngine_II(V35);
CreateOleDBEngine_II函数代码如下:
Function TKADaoDatabase.CreateOleDBEngine_II(const ClassName: string): IDispatch;
Const
DBEngine_TGUID: TGUID = '{00000021-0000-0010-8000-00AA006D2EA4}';
Var
LicenseClass : IClassFactory2;
DWReserved : DWORD;
LicenseString : Widestring;
ClassID : TGUID;
Begin
ClassID := ProgIDToClassID(ClassName);
//****************************************************************************
LicenseClass := Nil;
OleCheck(CoGetClassObject(ClassID,CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER, nil, IClassFactory2, LicenseClass));
if Assigned(LicenseClass) Then
Begin
SetLength(LicenseString,2000);
DWReserved:=0;
if F_RuntimeLicense <> '' Then
LicenseString := F_RuntimeLicense
Else
LicenseClass.RequestLicKey(DWReserved,LicenseString);
OleCheck(LicenseClass.CreateInstanceLic (nil, nil, DBEngine_TGUID, LicenseString, Result));
End;
//****************************************************************************
End;