' Database Loading Script ' ' Version 0.1.0.0 2002/04/05 by: David Warden. ' Copyright (C) 2002 McGraw-Hill Companies Inc. All Rights Reserved. ' ' This script will load the sample data for use with the book ' Database Management Systems by Raghu Ramakrishnan and Johannes Gehrke. ' Dim Internet_Explorer, Oracle_Username, Oracle_Password, Windows_Shell, ReturnCode, Installation_Path On Error Goto 0 Installation_Path=Left(WScript.ScriptFullName,InstrRev(WScript.ScriptFullName,"\")) ' ' Display Form ' Set Internet_Explorer=WScript.CreateObject("InternetExplorer.Application") Internet_Explorer.left=232 Internet_Explorer.top=274 Internet_Explorer.height=220 Internet_Explorer.width=560 Internet_Explorer.menubar=0 Internet_Explorer.toolbar=0 Internet_Explorer.statusbar=0 Internet_Explorer.navigate Installation_Path + "exercise_data\password_prompt.html" Internet_Explorer.visible=1 Do While (Internet_Explorer.Busy) Loop Do Loop While (Internet_Explorer.document.script.Complete()=False) If err <> 0 Then WScript.Quit() End if Oracle_Username=Internet_Explorer.Document.PasswordForm.OracleUsername.Value Oracle_Password=Internet_Explorer.Document.PasswordForm.OraclePassword.Value Internet_Explorer.Quit() Set Windows_Shell=WScript.CreateObject("WScript.Shell") Windows_Shell.CurrentDirectory=Installation_Path & "\exercise_data" ' ' Load data ' ReturnCode=Windows_Shell.Run("cmd /c sqlplus " & Oracle_Username & "/" & Oracle_Password & " @dbbook.sql 0 Then MsgBox "There was an error loading the data." & vbCRLF _ & "Please Check Your Configuration, Username, and Password." & vbCRLF _ & "To try again click on: bookinst",vbOKOnly + vbExclamation ,"Loading Failed" WScript.Quit() End If ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=faculty.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=class.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=enrolled.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=emp.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=dept.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=works.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=parts.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=suppliers.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=catalog.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=aircraft.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=employees.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=flights.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=certified.ctl log=NUL",1,True) ReturnCode=Windows_Shell.Run("sqlldr " & Oracle_Username & "/" & Oracle_Password & " control=sailors.ctl log=NUL",1,True) ' ' Exit ' MsgBox "The data has been loaded into Oracle.",vbOKOnly + vbInformation,"Loading Complete" WScript.Quit()