Thursday, March 26, 2009

Create Automatic SQL Server Express Backup

CREATE AN SQL FILE
Login to Microsoft SQL Server Management Studio.
Right click on your database from the “Databases” node.
Select “Tasks” -> “Back up…”
You are now presented with the “Back up Database” window. In this window you can specify your backup settings. At a minimum, you need to create a destination for your backup. Click the “Add” button and specify a full path name for your database backup in the “File name” field. You will need to use this path name later, so let’s take note of it.
You can choose any other backup options that are important to you. Over on the left hand side is “Options”. I would click on that and decide whether you want to use “append to an existing backup set” or “overwrite all existing backup sets”.
Once you are finished with your settings, you need to create an SQL file which will be used later for the automated database backup. To create that SQL file, click on the arrow next to “Script” at the top of the window. There will be an option for “Script action to File”. Go ahead and select that option. You will then be able to save your SQL Server Script File. Take note of where you have saved this file as well.
CREATE A BATCH FILE
Now that we have created the SQL file, we need to create a batch file that can be automatically executed by the Task Scheduler. To create this file, do the following:

Open Notepad and enter the following:
sqlcmd -S .\SQLEXPRESS -i "C:\Users\Administrator\Documents\Backup.sql"
Of course, substitute the pathname with the pathname of where you saved your SQL file.
Save this file and take note of where you saved it.
Now, using Windows Explorer, go to the directory of where you created this file and rename it to have a .bat filename extension instead of .txt.
SET BATCH FILE TO RUN IN WINDOWS TASK SCHEDULER
We are now ready to add the batch file to the Task Scheduler. Rather than using the Task Scheduler GUI, I prefer to do it on the command line. You can open a command prompt as Administrator or if you are already running as Administrator, you can use Start -> Run. Either way, enter the following:

schtasks /create /sc Daily /st 03:30:00 /tn "MyTask" /tr "cmd /c C:\Users\Administrator\Desktop\Backup.bat"

Again, substitute the pathname above with that of your batch file.

Also, set the time specified to something that is desirable for you. In the above example, we run this task at 3:30 AM.

Wednesday, March 11, 2009

Attach DB to SQL Server

This example attaches two files from pubs to the current server.

EXEC sp_attach_db @dbname = N'pubs',
@filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf',
@filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf'

SQL Server Express and classic asp connection, permission denied, (local)

If SQLExpress has been installed as a named instance instead of
the default instance, (local) will not work as a location in the connection string.

local)\SQLExpress and .\SQLExpress should work
and possibly localhost\SQLExpress if the tcp protocol has been enabled.

Access is denied when installing SQL Server Express 2008

The following error has occurred:
Access is denied
SqlEngineDBStartConfigAction_install_configrc_Cpu32

-----

This failure often is caused by a system or domain policy removing the SeDebugPrivelege security privilege from the administrator account running setup. Verify that the account running has this privilege.

The AccessChk tool will print all privleges for an account (http://technet.microsoft.com/en-us/sysinternals/bb664922.aspx) by running:accesschk.exe -a \ *
Alternatively, we can check this through your group policy editor as mentioned below:
Open Group Policy... Start Run Type: gpedit.msc OK Navigate to Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\Debug programs

The account through which we are trying to run the setup should be here ( besides the local admin on that machine). I included that here, restarted the server ( this is mandatory, gpupdate /force will not work) and ran the setup and it was successful this time.
SQL Server 2008 setup needs this privilege to start up the SQL Server process and listen to an event that signals back to setup that SQL Server successfully started.

Tuesday, March 10, 2009

Reinstall MDAC on Widows Server 2003

How to repair a Microsoft Data Access Component (MDAC) Installation on a Windows 2003 Service Pack 2 or Windows XP Service Pack 2 server when the operating system installation files and/or service pack installation files are not available.
--------------------------------------------------------------------------------
Details:
1. Click on Start > Programs > Accessories > Notepad.
2. Click on File > Save As to save the blank document.
3. Browse to the root of the C:\ drive.
4. Name the file: MDACRdMe.htm, click Save.
5. Close Notepad.
6. In Windows Explorer, open the c:\Windows\Inf folder.
7. Right-click the Mdac.inf file, and then click Install.
8. You will be prompted for multiple files during the installation.
9. At each prompt, click on browse and navigate to the appropriate file (see list below), click on Open then Retry.
10. There will be no notification when the installation is complete.

Files and Corresponding Locations

· File Name: adcjavas.inc
· Location: C:\Program Files\Common Files\System\msadc

· File Name: adojavas.inc
· Location: C:\Program Files\Common Files\System\ado

· File Name: msdadc.dll
· Location: C:\Program Files\Common Files\System\ole db

· File Name: dao360.dll
· Location: C:\Program Files\Common Files\Microsoft shared\dao

· File Name: handler.reg
· Location: C:\Program Files\Common Files\System\msadc

· File Name: oledbjvs.inc
· Location: C:\Program Files\Common Files\System\ole db

· File Name: MDACRdMe.htm
· Location: C:\

Monday, March 09, 2009

How to enable debug privileges for a user account

How to enable debug privileges for a user account (xp pro)
In the run box type: secpol.msc then click ok
expand "Local Policies"
click the "User Rights Assignments" folder
On the right hand screen double click "Debug Programs"
Click the "Add User or Group" button
Click the "Advanced" button
Click the "find now" button
select your "user logon name" and then click the "ok" button
click the "ok" button 2 more times

Tuesday, April 18, 2006

Resetting an Acer Travelmate 529TXV BIOS Password

1. Face the open laptop and look at the upper center piece of plastic above the keyboard that says "Acer Travelmate."

2. Notice the two plastic ends on either side of that narrow piece of plastic.

3. Pry the two ends outward using a flat head screwdriver.

4. Lift the center piece up and out.

5. Lift the keyboard up and out.

6. Locate the seven switch keyboard switch. This is the only switch or jumper visible and is located around the center bottom of the opening under the keyboard. It is white.

7. Set switch 6 to on. This disables the BIOS password on startup.

8. Boot the computer, go into BIOS, and clear out the old password.

This was a real pain in the rear to find on the internet! Irritating.

Here's a GREAT website with service manuals online for FREE:

www.eserviceinfo.com