Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Object required for (Wscript.sleep 15000)

Object required for (Wscript.sleep 15000)

From: benazir <benazir_zardari_at_yahoo.com>
Date: 5 May 2004 00:14:35 -0700
Message-ID: <35a97e60.0405042314.39ee6380@posting.google.com>


Dear Howard,

 I got your backup code from the Dizwell web site. It seems a very good way to perform backup via macro but it may contains some bug,which one can found initially when it run through the Excel.

For Example:
 When we run the following macro in Excel, we got errors like:

  1. Object required for (Wscript.sleep 15000)
  2. Object required for (Wscript.Echo "Not in Archivelog Mode! Hot Backups not possible! Aborting!")
  3. File Not found (strArchive = "arcchk.txt) (Set objArchive = objFS.OpenTextFile(strArchive, 1, 0)

I am using the following code, which checks you are in archivelog mode, and abort the entire thing if not. No point in trying to perform a hot backup unless you are.

I set the password for system according to my requirement. For testing purpose I also put my database in no archive log and the change the mode to archive log but I can&#8217;t able to run the macro successfully.
I think we have to define some variables in order to run that macro successfully.
Could you please suggest about it?

Regards

Benazir

CODE: Sub ArchivelogChk

'This module checks you are in archivelog mode, and aborts the entire
thing
'if not. No point in trying to perform a hot backup unless you are.

	strFileOut="archive.sql"
	strBp="set trimspool on" & chr(10) & "set heading off" & chr(10)
&"set feedback off" & chr(10) & "set echo off" & chr(10) & "spool arcchk.txt"
	set objFS=CreateObject("Scripting.FileSystemObject")
	set objOutFile=objFS.OpenTextFile(strFileOut,2,1)
	strOutput=strBp & chr(10) & "select log_mode from v$database;" &
chr(10) & "spool off" & chr(10) & "exit"
	objOutFile.WriteLine strOutput
	Set WshShell=CreateObject("WScript.Shell")
	WshShell.Run "sqlplus system/manager @archive.sql"

	Wscript.sleep 15000

	strArchive="arcchk.txt"
	set objArchive=objFS.OpenTextFile(strArchive,1,0)

	While Not objArchive.AtEndOfStream
		strInput=objArchive.ReadLine
		if strInput="" then 		
		else
			If strInput<>"ARCHIVELOG" Then
			title = "Fatal Error!"
			Wscript.Echo "Not in Archivelog Mode! Hot Backups not possible!
Aborting!"
				set objFile=Nothing
  				set objOutFile=Nothing
				set objArchive=Nothing
				set objFS=CreateObject("Scripting.FileSystemObject")
				objFS.DeleteFile "arcchk.txt"
				objFS.DeleteFile "archive.sql"
			Wscript.Quit 1
			End If
		End If
	wend

	set objFile=Nothing
	set objOutFile=Nothing	
	set objArchive=Nothing

End Sub Received on Wed May 05 2004 - 02:14:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US