Solved

how to login a computer?

Posted on 2002-05-31
8
228 Views
Last Modified: 2010-04-04
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
Comment
Question by:sunrains
8 Comments
 
LVL 9

Expert Comment

by:ginsonic
ID: 7048315
interested, too.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 7048325

 
0
 
LVL 4

Accepted Solution

by:
nestorua earned 100 total points
ID: 7048742
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
Independent Software Vendors: 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!

 

Author Comment

by:sunrains
ID: 7049163
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
 
LVL 12

Assisted Solution

by:Lee_Nover
Lee_Nover earned 100 total points
ID: 7049218
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
 
LVL 5

Expert Comment

by:Hamlet081299
ID: 7050072
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
 
LVL 1

Expert Comment

by:pnh73
ID: 9010398
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

Independent Software Vendors: 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!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 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