Link to home
Start Free TrialLog in
Avatar of ivylnm
ivylnm

asked on

Database Connection Err .

I cannot understand how to connect to database located at another machine.  This is what I have done for the program and the error message shown below appears.

    sList := TStringList.Create;
    sList.add('Server Name=\\IVY\C\IVYFOLDER\ABCDB.GDB);
    sList.add('User Name=' + 'SYSDBA');
    sList.Add('SQLQRYMODE:SERVER');
    Session.AddAlias('ABCDBAlias', 'INTRBASE', sList);
    Session.SaveConfigFile;
    FDatabase := TDatabase.create(application);
    with FDatabase do begin
      AliasName := 'ABCDBAlias';
      DatabaseName := 'db';
      LoginPrompt := false;
      with Params do begin
        Clear;
        Add('user=sysdba');
        Add('password=masterkey');
      end;
      Connected := true;
    end;


Project abc.exe raised exception class
EDBEngineError with message
'Unknown database. Unable to
complete network request to
host "Ivy". Fialed to establish
a connection.
Alias:db'. Process stopped. Use
Step or Run to continue.


For information, I am using Delphi4 and I have LAN network over my PC and 'IVY' Pc.
Avatar of kretzschmar
kretzschmar
Flag of Germany image

which network-protocol is used?
Avatar of ivylnm
ivylnm

ASKER

Network protocol?? What do you mean? Netbeui??
from borland:

--- paste begin

Problem:
How to specify my protocol of choice via the connect string.

Solution:
Supported protocols by platform:
Unix:
TCP/IP

Windows:
TCP/IP
NetBeui

Novell:
TCP/IP
IPX/SPX (InterBase 16bit only) InterBase version V4.0A(4)
IPX/SPX (InterBase 32bit) InterBase version V4.2.2

"Remote" connection string syntax:
TCP/IP
  (syntax) = "server_name:drive:pathmydatabase.gdb"
  (example) = "mtnbkr:d:ibserverexamplesemployee.gdb"

SPX/IPX
  (syntax) = "server_name@volume:pathmydatabase.gdb"
  (example) = "flash@sys:interbasexamplesemployee.gdb"

NetBeui
  (syntax) = "server_namedrive:pathmydatabase.gdb"
  (example) = "mtnbkrd:ibserverexamplesemployee.gdb"


-- paste end

see also
http://community.borland.com/article/interbase/trbshot_ib_connection_errs.pdf

meikl ;-)
Avatar of ivylnm

ASKER

so if my protocol is NetBeui,  i just make changes as below ya:

   sList := TStringList.Create;
   sList.add('Server Name=IVY:C:IVYFOLDER\ABCDB.GDB);
   sList.add('User Name=' + 'SYSDBA');
   sList.Add('SQLQRYMODE:SERVER');
   Session.AddAlias('ABCDBAlias', 'INTRBASE', sList);
   Session.SaveConfigFile;
   FDatabase := TDatabase.create(application);
   with FDatabase do begin
     AliasName := 'ABCDBAlias';
     DatabaseName := 'db';
     LoginPrompt := false;
     with Params do begin
       Clear;
       Add('user=sysdba');
       Add('password=masterkey');
     end;
     Connected := true;
   end;


I will try later on if above is correct.
Avatar of ivylnm

ASKER

I actually test on IVYC:IVYFOLDER\ABCDB.GDB as mentioned .  But it failed!
ASKER CERTIFIED SOLUTION
Avatar of Johnch
Johnch

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial