BDE、Windows 7 和 UAC [英] BDE, Windows 7 and UAC
问题描述
我有一个用 delphi 5 编写的非常老的应用程序,在一些使用 BDE 的客户中运行.现在一些使用 Windows Vista 和 7 的用户已经尝试了多用户访问的一些问题.我认为这些问题与 net
. 和 .lck
文件的位置有关.所以问题是在 Windows Vista 和 7 下配置 BDE
以避免权限和 UAC 冲突的正确方法是什么?
I have a very old application written in delphi 5 running in some customers which uses the BDE. Now some users with Windows Vista and 7, had experimented some problems with the multiuser access. i' think which these problems are related to the location of the net
.and .lck
files. so the question is which is the proper way to confgure the BDE
under Windows Vista and 7 to avoid permissions and UAC conflicts?
推荐答案
除了上述答案之外,您还需要确保 .net 和 .lck 文件位于 Windows 7 下的用户特定目录中,特别是:
In addition to the above answer, you'll want to make sure that the .net and .lck files are located in a user-specific directory under Windows 7, specifically:
C:\Users\{User Name}\AppData\Local\{Your Company Name}\{Your Application Name}
这些是当前用户始终可以完全控制的唯一文件夹.
Those are the only folders that the current user will always have complete control over.
您可以使用以下代码获取此文件夹:
You can get this folder by using this code:
CSIDL_LOCAL_APPDATA = $001C;
function GetAppDataDirectory: AnsiString;
var
TempBuffer: array[0..MAX_PATH] of AnsiChar;
ResultLength: Integer;
begin
FillChar(TempBuffer,((MAX_PATH+1)*SizeOf(AnsiChar)),0);
ShlObj.SHGetSpecialFolderPathA(0,@TempBuffer,CSIDL_LOCAL_APPDATA,False);
ResultLength:=StrLen(pAnsiChar(@TempBuffer));
SetLength(Result,ResultLength);
Move(TempBuffer[0],pAnsiChar(Result)^,(ResultLength*SizeOf(AnsiChar)));
end;
然后将 {Your Company Name}
和 {Your Application Name}
附加到返回的值.您需要包含 ShlObj 单元.
and then appending {Your Company Name}
and {Your Application Name}
to the value returned. You'll need to include the ShlObj unit.
这篇关于BDE、Windows 7 和 UAC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!