• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

how to login a computer?

i want do some program in delphi. my database is mssql2000.when i connect the mssql,i must login the computer with mssql,but the client maybe not login the server! how can i login the server in my delphi program?
0
sunrains
Asked:
sunrains
2 Solutions
 
ginsonicCommented:
interested, too.
0
 
sudhakar_koundinyaCommented:

 
0
 
nestoruaCommented:
HI,
When you register your MSSQL Server use SQL Server login info
, not Windows NT login info.
And you don't need to login in the computer with MSSQL Server,
only to the MSSQL Server itself.
Sincerely,
Nestorua.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
sunrainsAuthor Commented:
the MSSQL Server is W2k,the Client is Win98Se or W2k professional. my Delphi application use ADO connect the MSSQL Server. and the client is not install MSSQL Server.
0
 
Lee_NoverCommented:
ah so you want to do something like a service ?
that can run even if a user isn't logged on to the computer ?

I suggest using SvCom
it can crate an application that runs as a service on NT plaforms and as normal exes on 9x platforms

you could create two separate apps
one to run on win9x and one for NT

another way is to create a wrapper for NT Services
then uppon application startup you check what platform is the app run on
if it's win 9x then use RegisterServiceProcess to register your app as a "service"
to make windows run your app automaticall uppon boot (not user login) you have to add a registry entry in the HKLM\software\microsoft\windows\currentversion\runservices\ key

here's my wrapper function for this :

uses Registry;
function AutoRunApp(const Name: string; const Enabled: Boolean = true): Boolean;
const RunWhere = '\Software\Microsoft\Windows\CurrentVersion\RunServices';
begin
     Result:=false;
     with TRegistry.Create do
       try
          RootKey:=HKEY_CURRENT_USER;
          if OpenKey(RunWhere, true) then
             try
                if Enabled then
                   WriteString(Name, ParamStr(0))
                else
                   DeleteValue(Name);
                Result:=true;
             finally
                CloseKey;
             end;
       finally
          Free;
       end;
end;


for an NT Service wrapper you can use KOL Service
http://bonanzas.rinet.ru/
http://bonanzas.rinet.ru/e_servsock.htm for direct link :)


...
0
 
Hamlet081299Commented:
I find the best way of connecting to MSSQL in Delphi is by using the ADO components.

As a rule I will have some sort of configuration (ini or registry) that tells the app which connection file to use.

The connection file is a microsoft datalink file (".udl" extension).  Here you can specify the username and password.
0
 
pnh73Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between Lee_Nover and nestorua

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now