Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Connecting to SqlServer 2000 by BDE

Posted on 2003-03-04
8
Medium Priority
?
2,852 Views
Last Modified: 2013-11-23
Hi

  I want to connect to SqlServer2k by BDE.My application
is in Delphi 7 and i use MSSQL from BDE to connect.
When i try this i get this message:

BDE Error:10036
Unknown user name or password.

BDE Error:13059
Server Error:18452
Login failed for user 'username'. Reason: Not associated with a trusted SQL Server connection.

BDE Error:13059
Server Error:10003
Login incorrect.

I can connect to SqlServer by ADO without problem.

Thanks
0
Comment
Question by:s_arb
  • 4
  • 2
  • 2
8 Comments
 
LVL 1

Expert Comment

by:TAZI
ID: 8063286
Hi

Install SQLLinks onto the machine and then do the following

Drop a TDatabase Component on your form and set the properties as follows

AliasName = <blank> or <null>
Connected = False
DatabaseName = Your DB Name
KeepConnected = False
LoginPrompt = False
Name = Database1

Add the following procedure to your application

procedure TForm1.Reconnect;
begin
   Database1.KeepConnection := False;
   Database1.Connected := False;
   Database1.params.clear;
   Database1.params.Add('USER NAME=sa');
   Database1.params.Add('PASSWORD=' + DBPassword.Text);
   Database1.params.Add('DATABASE NAME='+DatabaseName.Text);
   Database1.params.Add('SERVER NAME='+ServerName.Text);
   Database1.params.Add('MAX QUERY TIMEOUT=-1');
   Database1.params.Add('HOST NAME=' + WindowsUserName);
   Database1.params.Add('TIME OUT=-1');
   Database1.Connected := True;
end;

procedure TForm1.OnFormCreate(Sender : TObject)
begin
  Reconnect; //This will connect you to sql server
end;

Hope this information helps
Regards
TAZI
0
 

Author Comment

by:s_arb
ID: 8063688
I tried that but i got the same error.
0
 
LVL 1

Expert Comment

by:TAZI
ID: 8063736
Hi

I use this all the time ... but I do it via Delphi5

I don't see why you're having a problem

Will continue checking and keep you informed

Regards
TAZI
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Expert Comment

by:TAZI
ID: 8063798
Hi

I've just tested it on a machine thats running Windows 2000 and Delphi 7 connecting to SQL SERVER 2000.  It works 100% no errors.

Make sure you have the BDE SQL Links installed.

There are 2 files that are required

ntwdblib.dll and dbnmpntw.dll ..... they should reside in the system32 folder.

Regards
TAZI
0
 
LVL 1

Expert Comment

by:TAZI
ID: 8063807
If this does not work ... send me your test app

email: mumtazm@mbd.co.za

I will then look at it from this side.

Regards
TAZI
0
 
LVL 9

Accepted Solution

by:
mocarts earned 210 total points
ID: 8064943
check authentication mode of your SQL server, ensure SQL Server authentication mode is selected (in Enterprise Manager you can change this in Server Properties dialog under Security tab clear (uncheck) "Windows NT only" check box)
wbr, mo.
0
 
LVL 9

Expert Comment

by:mocarts
ID: 8065074
to chagne in Registry:
under HKEY_LOCAL_MACHINE\Software\Microsoft\MSSqlserver\MSSqlServer\ key find LoginMode subkey and change it to 2 (Hexdecimal)

more info:
http://support.microsoft.com/default.aspx?scid=KB;en-us;q325022#7a

wbr, mo.
0
 

Author Comment

by:s_arb
ID: 8069843
Thank to all of you
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

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…
This is an update to some code that someone else posted on Experts Exchange. It is an alternate approach, I think a little easier to use, & makes sure that things like the Task Bar will update.
Screencast - Getting to Know the Pipeline
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

580 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