Solved

Using SQL-DMO to change login password and shrink database

Posted on 2002-07-03
3
285 Views
Last Modified: 2010-05-18
I am moving an app from Access to MSDE and have created a utility to backup and restore sql database using DM0 in VB6. I would also like to include functionality to change the login password and to shrink the database. Can anyone provide some code for these functions? Thanks.
0
Comment
Question by:quicdoc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Accepted Solution

by:
curtis591 earned 100 total points
ID: 7127061
I got these examples from the BOL.

This example changes the password for the login Victoria to ok.

EXEC sp_password NULL, 'ok', 'Victoria'

This example decreases the size of the files in the UserDB user database to allow 10 percent free space in the files of UserDB.

DBCC SHRINKDATABASE (UserDB, 10)

0
 

Author Comment

by:quicdoc
ID: 7127269
I am looking for some sample code to use with DMO but thanks anyway
0
 

Expert Comment

by:CleanupPing
ID: 9280203
quicdoc:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

691 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