CColorDialog dlg; dlg.DoModal(); m_crCurColor = dlg.GetColor();//COLORREF m_crCurColor; BYTE r = GetRValue(m_crCurColor); BYTE g = GetGValue(m_crCurColor); BYTE b = GetBValue(m_crCurColor); 數據庫備份 Declare @name varchar(250) EXEC Master..xp_cmdShell 'echo D:\ &cd D:\ &D: &if not exist database md database' Set @name='D:\database\naneXXXX _'+ convert(varchar(50),getdate(),112)+'.bak' BACKUP DATABASE naneXXXX TO DISK=@name WITH NOFORMAT, NOINIT, NAME = N'naneXXXX -完整 數據庫 備份', SKIP, NOREWIND, NOUNLOAD 出現問題找不到 ···xp_cmdShell的解決方法: SQL Server 阻止了對組件 'xp_cmdshell' 的 過程'sys.xp_cmdshell' 的訪問,因為此組件已作為此服務器 選擇master數據庫執行下面語句 sp_configure 'show advanced options',1 reconfigure go sp_configure 'xp_cmdshell',1 reconfigure go deleteOldBackup DECLARE @OLDDATE DATETIME EXEC Master..xp_cmdShell 'echo D:\ &cd D:\ &D: &if not exist database md database' SELECT @OLDDATE=GETDATE()-7 EXECUTE master.dbo.xp_delete_file 0,N'D:\database',N'bak',@olddate 收縮日志 dump transaction naneXXXX with no_log; backup log naneXXXX with no_log; dbcc shrinkfile(2);