ProgrammingMSAccess.com

Learn about Developers Group
Join Developers Group
Order SPAM Blocker
Free Stuff
Guest Book
.NET Resources
SQL Server Resources
Favorites
Technical Support
Books & DVDs by Webmaster
Articles, tutorials, & more
FAQs
Product Reviews
Samples
Prior Newsletters
Contact Us
Home
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This procedure is meant to run from a project with a reference to the microsoft sqldmo object library.  The code demonstrates how to change the authentication mode of a sql server instance to windows authentication mode.  it also shows how to stop, wait for the stop to complete, and restart a server to allow the new authentication mode setting to update the server.

Sub ToWindowsAuthentication()
Dim srv1 As SQLDMO.SQLServer

'Assign whatever server name you like;
'default is CABLAT
srvname = "CABLAT"

'Instantiate a SQLServer object and connect
'using integrated
Set srv1 = New SQLDMO.SQLServer
srv1.LoginSecure = True
srv1.Connect srvname

'Set Security mode to mixed Windows/SQL Server
'authentication
srv1.IntegratedSecurity.SecurityMode = SQLDMOSecurity_Integrated
srv1.Disconnect

'Invoke command to stop server and wait
'until it stops
srv1.Stop
Do Until srv1.Status = SQLDMOSvc_Stopped
Loop

'Restart server with mixed security
srv1.Start True, srvname

'Clean up
srv1.Disconnect
Set srv1 = Nothing

End Sub

Want to understand  Microsoft Access 2000 so that you can program it to do more tasks like this?  Get Professional SQL Server Development with Access 2000 by Rick Dobson from Wrox Press.  Learn more about the book by clicking here.

Copyright 2000 CAB, Inc. All rights reserved. Republication or redistribution of CAB, Inc. content, including by framing or similar means, is expressly prohibited without the prior written consent of CAB, Inc. CAB, Inc. shall not be liable for any errors in the content, or for any actions taken in reliance thereon.