[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to log on to remote Windows 2000 system

Posted on 2002-05-17
3
Medium Priority
?
196 Views
Last Modified: 2013-11-20
Hi,

I am looking for help on how to log on to remote
computer programatically.

As part my project I need query a MSDE on remote
Windows 2000 system. But my ADO connect () call is
failing unless the system I am making connect() call
logon to remote Windows 2000 system where I have
MSDE datbase. Could you let me know how log on
to Windows remote system from Windows 2000 system
using MFC or Win32 calls ??

Regards
0
Comment
Question by:rkpalli
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 600 total points
ID: 7016609
If you need to access the DB as a file, try to connect to a share on the machine without logging on:

   NETRESOURCE               nr;

         ZeroMemory     (     &nr,     sizeof     (     NETRESOURCE));

         nr.dwType               =     RESOURCETYPE_DISK;
         nr.lpLocalName          =     "";
         nr.lpRemoteName          =     "\\\\server\\share";

         dwRes     =     WNetAddConnection2     (     &nr,
                                                      acPassword,
                                                      acUserName,
                                                      0
                                                 );

         if     (     dwRes)
              {
                   // error
              }

0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7018460
It might be worth a try to set the MSDE settings on the server to use "SQL Server Authentication" (rather than "Windows 2000 integrated security") and also make sure that the ODBC settings on the client are set to use TCP/IP (rather than named pipes).

-- Dan

0
 

Expert Comment

by:amarzee
ID: 7023681

CreateProcessAsUser() will help us to create a process as if we are currently log on to particular server. This may be the thing you are looking for
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

830 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