RE: connecting to a SQL2000 Server using Windows authentication

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Richard J (anonymous_at_discussions.microsoft.com)
Date: 04/29/04


Date: Thu, 29 Apr 2004 05:46:03 -0700

Peter,

The easiest method I have found for developers connecting to a database for the first time is to use the Microsoft ADO Data Control (look in Project | Components). Drop the control on your form, and click the Custom property to bring the property pages up. Build the connection string by following through with the wizard. Once built and the connection tested, copy the string from the text box on the first tab and paste it directly into your code.

I'll leave it up to you to do a little light reading in MSDN concerning the ADO Connection Object.

As for testing the connection, you tested it from the ADO Data Control. Also, you should be able to check the State property of the connection object to see if you are connected.

Good luck.
     
     ----- Peter Newman wrote: -----
     
     Ive been using VB6 ( sp5) to connect to a SQL server using a DSN and SQL authentication. I have run into afew difficulities and it has been suggested that i should try using Windows authentication on the server instead.
     
     to this end i have set up a dev server to look at this problem. After setting up a user on the server, how can i
      1. connect to the server from a workstation using vb
      2. check if the user is connected to the server
     
      for this test the server is called SERVER1 and ther user logon is TESTSYS\FRED
     
     any pointers would be mist greatful
       
     



Relevant Pages

  • Re: Exchange 2003 ADO SELECT performance
    ... You will want to open an ADO connection object and pass it to your Rec.Open ... > I have written a application that, among other things, updates ... Dim RS As New ADODB.Recordset ...
    (microsoft.public.exchange.development)
  • Re: Accessing text / csv files using ADO in C++
    ... the Open method of the ADO Connection object. ... _ConnectionPtr spConn; ... After you have a Connection object you can use the Errors Collection to ...
    (microsoft.public.data.ado)
  • Re: E_Fail Status with VB6
    ... "Either BOF or EOF is True, or the current record has been deleted. ... Requested operation requires a current record." ... My ADO Connection object doesn't show any errors ...
    (microsoft.public.vb.general.discussion)
  • Re: How do I know a query is finished?
    ... query is finished I want a message box to say "Update complete" ... You could use an ADO Connection object to run the SQL command ...
    (microsoft.public.access.formscoding)
  • mysql_query problem
    ... I've got a prod and a dev server, the version of MySQL and PHP on both are ... script that works on the DEV server. ... creates the connection object and passes it to the other functions, ...
    (php.general)