Solved

Database Connection Err .

Posted on 2001-07-19
6
196 Views
Last Modified: 2010-05-18
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.
0
Comment
Question by:ivylnm
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6301063
which network-protocol is used?
0
 

Author Comment

by:ivylnm
ID: 6301203
Network protocol?? What do you mean? Netbeui??
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6301285
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 ;-)
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:ivylnm
ID: 6301346
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.
0
 

Author Comment

by:ivylnm
ID: 6301363
I actually test on IVYC:IVYFOLDER\ABCDB.GDB as mentioned .  But it failed!
0
 
LVL 1

Accepted Solution

by:
Johnch earned 100 total points
ID: 6301439
Try the following to connect to

NameofServer:Drive:\Folder\database.gdb

So I presume IVY is your Server and your database is located at c:\ivyfolder\abcdb.bdg


IVY:C:\IVYFOLDER\ABCDB.GDB



John.
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question