Como faço para saber se o bde já está instalado na máquina ?

20/05/2003

0

PRECISO DESCOBRIR SE O BDE ESTÁ INSTALADO NA MÁQUINA...SE NAUM ESTIVER MINHA APLICAÇÃO VAI INSTALAR SE JÁ TIVER INSTALADO SÓ VOU CRIAR O ALIAS..CREIO QUE SEJA SIMPLES ALGUÉM PODE ME AJUDAR ???
AGRADEÇO ANTECIPADAMENTE !!!


Morpheus

Morpheus

Responder

Posts

21/05/2003

Neo_coder®

Vc pode checar se esta chave se encontra no registro:

HKEY_LOCAL_MACHINE\SOFTWARE\Borland\Database Engine



Tenho este código de exemplo abaixo, mas só irá funcionar em win2000 em contas com direito de Administrador.



procedure TfmStopBDE.ReadWriteBDEStatus( Writing : Boolean;
WantBDEOn: Boolean);
{----------------------------------------------------------------------------------------------------------------------}
{ Read or write the value for the BDE path in the registry. }
{ If Writing is True, then the WantBDEValue will uncomment the registry path, otherwise it comments the registry path. }
{ If Writing is False, then it reads the BDE path in the registry and assigns it to the variable BDEDir (the registry }
{ is not changed and the WantBDEOn variable is ignored. }
{----------------------------------------------------------------------------------------------------------------------}
begin
BDEDir := ´´;
with TRegistry.Create do
try
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey(cBDEKey, False) then
begin
BDEDir := ReadString(cBDEValue);
if Writing then
begin
if WantBDEOn and (Copy(BDEDir,1,1) = cComment) then
Delete(BDEDir,1,1)
else if not(WantBDEOn) and (Copy(BDEDir,1,1) <> cComment) then
BDEDir := cComment + BDEDir;
WriteString(cBDEValue, BDEDir);
end;
end
else
begin
buOn.Enabled := false;
buOff.Enabled := false;
Raise Exception.Create(´BDE is not installed´+#1310+
´Registry Key: HKEY_LOCAL_MACHINE´+cBDEKey+´´ is missing in the registry.´);
end;
finally
Free;
StatusBar1.SimpleText := BDEDir;
end;
end;


Jesus Cristo Vive e é o Senhor.


Responder

23/05/2003

Carnette

PRECISO DESCOBRIR SE O BDE ESTÁ INSTALADO NA MÁQUINA...SE NAUM ESTIVER MINHA APLICAÇÃO VAI INSTALAR SE JÁ TIVER INSTALADO SÓ VOU CRIAR O ALIAS..CREIO QUE SEJA SIMPLES ALGUÉM PODE ME AJUDAR ??? AGRADEÇO ANTECIPADAMENTE !!!


Função para descobrir se o BDE existe na máquina

uses
BDE;

function CheckBDEInstalled: Boolean;
begin
Result := (dbiInit(nil) = DBIERR_NONE)
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
if CheckBDEInstalled then
ShowMessage(´BDE is installed.´)
else
ShowMessage(´BDE is not installed.´)
end;


Responder

Que tal ter acesso a um e-book gratuito que vai te ajudar muito nesse momento decisivo?

Ver ebook

Recomendado pra quem ainda não iniciou o estudos.

Eu quero
Ver ebook

Recomendado para quem está passando por dificuldades nessa etapa inicial

Eu quero

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar