Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to Connect to IB 6.5 using Delphi 2005 (.NET)

Status
Not open for further replies.

FGSReidR

Programmer
Dec 9, 2005
2
US
I am looking at the examples that come with Delphi 2005 and am copying the connection string correctly. I have an ASP.NET app with a BDPConnection component on a web form. A simple Username and Password textboxes with a button to connect.

The error I get is :

Connection open failed. Your user name and password are not defined. Ask your database administrator to set up an InterBase login.

I am using the default "SYSDBA" and "MASTERKEY" values so the login should be valid.

Here is the code:

const
C_CONNECTSTR = 'assembly=Borland.Data.Interbase, Version=2.0.0.0, Culture=neutral, PublicKeyToken=91d62ebb5b0d1b1b;vendorclient=gds32.dll;database=127.0.0.1:C:\\InterbaseData\\master.gdb;provider=Interbase;';

C_CONNECTOPT = 'waitonlocks=False;transaction isolation=ReadCommitted;commitretain=False;sqldialect=1;servercharset=;rolename=myrole';


function TTechNotesMain.ConnectDB: Boolean;
begin
Result := TRUE;

try
if (BdpConnection.State <> ConnectionState.Open) then
begin

BdpConnection.ConnectionString := C_CONNECTSTR + 'username=' + txtLogin.Text + ';' +'password=' + txtPassword.Text;


BdpConnection.ConnectionOptions := C_CONNECTOPT;
BdpConnection.Open;

end;
finally
Result := (BdpConnection.State = ConnectionState.Open);

end;
end;

Can someone please point out why this is not working? Thank you

ReidR
 
I discovered that the problem was the case sensitivity of the password. It needs to be all lower case.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top