An error occurred while logging on to the application interface using BDE to connect to SQL Server 2000. Why? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiDB/html/delphi_20061218213005232.html
I use BDE to connect to SQL Server 2000 in the Application Program An error occurred while logging on to the interface. The prompt is as follows:
[Microsoft] [odbc SQL Server Driver] [SQL Server] user '(null)' Login Failed. Cause
It is not associated with a trusted SQL server connection.
What is the problem. Login button Code As follows:
Procedure tloginform. button1click (Sender: tobject );
VaR
Aname, apassword: string;
Begin
Aname: = trim (edit1.text );
Apassword: = trim (edit2.text );
Table1.open;
Table1.setkey;
Table1.fields [0]. asstring: = aname;
If table1.gotokey then
If table1.fields [1]. asstring = apassword then
If table1.fields [2]. asstring = 'internal Postmaster 'then
Begin
Table1.close;
Loginform. Hide;
Manageform. Show
End
Else
Begin
Table1.close;
Loginform. Hide;
Serveingform. Show
End
Else
Begin
Messagedlg ('you are not a legal user. Please exit! ', Mtinformation, [mbok], 0 );
Table1.close;
Loginform. close;
End;
End;
Thank you for your guidance.
Params in tdatabase is not assigned a value,
Database: = 'user name = sa Password = password '.
Is the database local or on another server? Are you authorized to access the database? The user name and password must be added when accessing the database ,,
The user and password for accessing the database are not set. The setting is OK.