Thanks, Mike, did _you_ try it _with_ the While Loop as well?

My NULL is/was -0- and without the loop it does work but the whole point
(see the end of the message) was to loop through any number of databases -
and that fails (for me).

It seems to do everything in the input file except get back to the command
file. Once I close R:Base the new database is there - but until R:Base is
closed.

And, as I just replied to Sami, the only reason for using the input command
was because of the instruction in the WhatsNew #78.

Regards,
Alastair.


----- Original Message ----- 
From: "MikeB" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[email protected]>
Sent: Tuesday, January 11, 2005 7:39 PM
Subject: [RBG7-L] - Re: Fw: [RBG7-L] - Unload/Input problem (Bug #71799)
W98SE


> Alastair,
>
> Just for giggles, I :
> 1.  set null to -0- Before the Unload
> 2. Got Rid of the While Loop (just to test)
>
> and the following worked OK, but as Sami pointed out, use Run instead (You
can
> "Write 'Return'" at the end of your unload before output screen to be
exactly
> correct)
>
> CLS
> SET NULL -0-
> CHDRV f:
> CHDIR \rb7\samples
> DISCONNECT
>
> SET VAR vdblist      TEXT = NULL
> SET VAR vitemname    TEXT = NULL
> SET VAR vcycle1   INTEGER = NULL
>
> SET VAR vdblist = 'ConComp,RRBYW4'
> SET VAR vcount  = (itemcnt(.vdblist))
> SET VAR vcycle1 = 0
> --WHILE vcycle1 < .vcount THEN
>
>   SET VAR vcycle1     = (.vcycle1 + 1)
> --  SET VAR vitemname   = NULL
>   SET VAR vitemname   = 'ConComp'
> --  SET VAR vitemname   = (SSUB(.vdblist, .vcycle1))
>   SET VAR voutputfile = (.vitemname + '.RLD')
>   SET VAR voutputlob  = (.vitemname + '.LOB')
>   SET VAR vcurrfiles  = (.vitemname + '.RB?')
>   SET VAR vrenfiles   = (.vitemname + '._B?')
>   CHDIR .vitemname
>   CONNECT .vitemname
> pause 4 using 'Begin Unload'
>   OUTPUT .voutputfile
>   UNLOAD ALL
>   OUTPUT SCREEN
> pause 4 using 'End Unload'
>   DISCONNECT
> pause 4 using 'Renaming Files'
>   RENAME .vcurrfiles .vrenfiles
> Pause 4 using 'Inputting Reload File'
>   INPUT .voutputfile
>   DISCONNECT
> pause 4 using 'Deleting Files'
>   DELETE .voutputfile
>   DELETE .voutputlob
>   DELETE .vrenfiles
> --  CHDIR \dbfiles
> --ENDWHILE
> cls
> pause 2 using 'Done'
> RETURN
>
>
> ----- Original Message ----- 
> From: "Alastair Burr" <[EMAIL PROTECTED]>
> To: "RBG7-L Mailing List" <[email protected]>
> Sent: Tuesday, January 11, 2005 1:08 PM
> Subject: [RBG7-L] - Fw: [RBG7-L] - Unload/Input problem (Bug #71799) W98SE
>
>
> Just following up on this problem:
>
> I have reduced the code to this:
>
> CLS
> CHDRV c:
> CHDIR \RBTI\RBG7\SAMPLES\DATABASES
> DISCONNECT
>
> SET VAR vDBList      TEXT = NULL
> SET VAR vItemName    TEXT = NULL
> SET VAR vCycle1   INTEGER = NULL
>
> SET VAR vDBList = 'ConComp,RRBYW1'
> SET VAR vCount  = (ITEMCNT(.vDBList))
> SET VAR vCycle1 = 0
> WHILE vCycle1 < .vCount THEN
>   SET VAR vCycle1     = (.vCycle1 + 1)
>   SET VAR vItemName   = NULL
>   SET VAR vItemName   = (SSUB(.vDBList, .vCycle1))
>   SET VAR vOutPutFile = (.vItemName + '.RLD')
>   SET VAR vOutPutLob  = (.vItemName + '.LOB')
>   SET VAR vCurrFiles  = (.vItemName + '.RB?')
>   SET VAR vRenFiles   = (.vItemName + '._B?')
>   CHDIR .vItemName
>   CONNECT .vItemName
>   OUT .vOutPutFile
>     UNLOAD ALL
>   OUT SCREEN
>   DISCONNECT
>   RENAME .vCurrFiles .vRenFiles
>   INPUT .vOutPutFile
>   DISCONNECT
>   DEL .vOutPutFile
>   DEL .vOutPutLob
>   DEL .vRenFiles
>   CHDIR \DBFILES
> ENDWHILE
>
> RETURN
>
> I still get the error message:
> Access violation at address 0101A515 in module 'RBENGINE.DLL'. Read of
address
> FFFFFFFF
> after the end of the input command.
> It seems that the INPUT command does not like anything to follow it - if
using
> a variable???
> This works at the R:> INPUT ConComp.RLD
> This also works at the R:> INPUT .vOutPutFile
> This fails at the R:> INPUT .vOutPutFile; DISCONNECT
>
> Can anybody confirm this, please?
>
> Thanks & regards,
> Alastair.
>
> ----- Original Message ----- 
> From: Alastair Burr
> To: RBG7-L Mailing List
> Sent: Monday, January 03, 2005 9:16 AM
> Subject: [RBG7-L] - Unload/Input problem
>
>
> Please can anybody see what I am doing wrong here:
>
> I have a program which appears to be written correctly - but remember that
> RStyle does not report any errors for v7.x under W98SE so I am not 100%
sure.
> Nevertheless, I cannot find anything wrong and it seems to do everything
> correctly.
>
> However, right at the end of the input file I get this error message:
>
> Access violation at address 0101A515 in module 'RBENGINE.DLL'. Read of
address
> FFFFFFFF
>
> It apparently fails after the last command in the input file before
returning
> to my program. I don't know if it's relevant but the violation address has
> changed with the installation of the latest beta (31/12/04).
>
> After exiting from R:Base the new database appears to have been created
without
> any errors and the last command, a rule definition, has been applied.
>
> I reported this as a bug a few weeks ago but RBTI/RDCC could not replicate
it.
> If I create a very simple version on my program and use it on ConComp
neither
> can I replicate it.
>
> This is that short version:
>
> SET VAR vDBtoReload TEXT = Reload.FLE
> CONNECT CONCOMP
>
> SET EOFCHAR ON
> OUTPUT .vDBtoReload
>   UNLOAD ALL
>   SET VAR vError = .vErrVar
> OUTPUT SCREEN
> DISCONNECT
>
> RENAME CONCOMP.RB? CONCOLD.RB?
>
> INPUT &vDBtoReload
> SET VAR vError = .vErrVar
> DISCONNECT
> RETURN
>
> This is my much longer program. The various called files are used in many
other
> places are I am 100% sure that they work correctly. Pause_Sub.CMD command
> produces a pause display while SetOwner.CMD forces entry of the owner
password
> and quits if it is not entered. Some variables are always available so are
not
> re-defined here:
>
> *( FileName: UnLoad_ReLoad.CMD  ...  ...  Date of last amendment:
03/01/2005 )
> *( Recreates the databases from UnLoad
       )
> -- This line extends to 78
characters - - - - - - - - - - - - - - - - - - - ->
> -- TRACE D:\DBCOPY\SOURCE\MULTIDAT\UnLoad_ReLoad.CMD
>
> SET VAR vCaption = +
>   'MultiDat Database - Maintenance: UnLoad and Input ALL Databases'
> SET CAPTION .vCaption
>
> SET VAR vCurrDB_Name       TEXT = NULL
> SET VAR vCurrDB_ShortName  TEXT = NULL
> SET VAR vCurrDB_DataPath   TEXT = NULL
> SET VAR vCurrDB_SourcePath TEXT = NULL
>
> SET VAR vBackDestination   TEXT = NULL
> SET VAR vLocal_DataPath    TEXT = NULL
>
> SET VAR vDBList            TEXT = NULL
> SET VAR vDbtoReload        TEXT = NULL
> SET VAR vItemName          TEXT = NULL
>
> SET VAR vCycle1         INTEGER = NULL
> SET VAR vDelFiles          TEXT = NULL
>
> -- -----------------------------------------------------------------------
----
> -- Set user as supervisor:
> -- -----------------------------------------------------------------------
----
> RUN D:\DBCOPY\SOURCE\MULTIDAT\SetOwner.CMD
>
> -- -----------------------------------------------------------------------
----
> -- Start of main application:
> -- -----------------------------------------------------------------------
----
> SET MULTI OFF
> CONNECT .vControlDB
> SELECT (LISTOF(Name_DataBase)) INTO vDBList FROM MultiDataBase +
>   WHERE RBG_Version = .vVersion ORDER BY Name_DataBase
> DISCONNECT
> SET VAR vCount = (ITEMCNT(.vDBList))
>
> CHDIR \DBFILES\MULTIDAT
>
> SET VAR vCycle1 = 0
> WHILE vCycle1 < .vCount THEN
>   SET VAR vCycle1   = (.vCycle1 + 1)
>   SET VAR vItemName = NULL
>   SET VAR vItemName = (SSUB(.vDBList, .vCycle1))
>
>   CONNECT .vControlDB
>
>   SET VAR vCurrDB_Name = .vItemName
>   SELECT ShortName INTO vCurrDB_ShortName FROM MultiDatabase +
>     WHERE Name_DataBase = .vCurrDB_Name
>   SELECT FileLocation INTO vCurrDB_DataPath FROM UserDirectories +
>     WHERE Name_DataBase = .vCurrDB_Name AND DirectoryType = 'Data'
>
>   DISCONNECT
>
>   SET VAR vLocal_DataPath    = (.vCurrDB_DataPath + '\' + .vCurrDB_Name)
>   SET VAR vDBtoReload        = (.vCurrDB_DataPath + '\' +
.vCurrDB_ShortName +
> '_COPY.FLE')
>   SET VAR vDelFiles          = (.vCurrDB_DataPath + '\' +
.vCurrDB_ShortName +
> '_COPY.LOB')
>   SET VAR vCurrDB_SourcePath = (.vLocal_DataPath + '.RB*')
>   SET VAR vBackDestination   = ('ORIG_' + .vCurrDB_ShortName + '.RB*')
>
>   SET VAR vMessage = ('Reloading' & .vCurrDB_Name & 'to new database')
>   SET VAR vCaption = 'Please wait...'
>   RUN D:\DBCOPY\SOURCE\MultiDat\Pause_Sub.CMD USING 3 INFO 0
>
> -- -----------------------------------------------------------------------
----
> -- Connect to database:
> -- -----------------------------------------------------------------------
----
>   CHDIR .vCurrDB_DataPath
>   CONNECT .vCurrDB_Name
>   SET VAR vError = .vErrVar
>   IF vError <> 0 THEN
>     DISCONNECT
>     SET VAR vMessage = ('Error connecting to database:' &
.vLocal_DataPath)
>     SET VAR vCaption = 'ERROR!'
>     RUN D:\DBCOPY\SOURCE\MultiDat\Pause_Sub.CMD USING 3 ERROR 0
>     GOTO lEnd
>   ENDIF
>   SET NULL -0-
>
> -- -----------------------------------------------------------------------
----
> -- Delete any old files:
> -- -----------------------------------------------------------------------
----
>   SET ERROR MESSAGE 2077 OFF -- file not found
>   ERASE &vDelFiles
>   SET VAR vDelFiles = .vDBtoReload
>   ERASE &vDelFiles
>   SET VAR vDelFiles = .vBackDestination
>   ERASE &vDelFiles
>   SET ERROR MESSAGE 2077 ON
>
> -- -----------------------------------------------------------------------
----
> -- Unload to file:
> -- -----------------------------------------------------------------------
----
>   SET EOFCHAR ON  -- R:Base default is ON so ensure default set.
>   OUTPUT .vDBtoReload
>     UNLOAD ALL
>     SET VAR vError = .vErrVar
>   OUTPUT SCREEN
>   DISCONNECT
>   IF vError <> 0 THEN
>     DISCONNECT
>     SET VAR vMessage = ('Error creating UnLoad file for database:' &
> .vDBtoReload)
>     SET VAR vCaption = 'ERROR!'
>     RUN D:\DBCOPY\SOURCE\MultiDat\Pause_Sub.CMD USING 3 ERROR 0
>     GOTO lEnd
>   ENDIF
>
> -- -----------------------------------------------------------------------
----
> -- Rename current database:
> -- -----------------------------------------------------------------------
----
>   RENAME &vCurrDB_SourcePath &vBackDestination
>   SET VAR vError = .vErrVar
>   IF vError <> 0 THEN
>     DISCONNECT
>     SET VAR vMessage = +
> ('Error renaming current database:' & .vCurrDB_SourcePath & 'to:' &
> .vBackDestination)
>     SET VAR vCaption = 'ERROR!'
>     RUN D:\DBCOPY\SOURCE\MultiDat\Pause_Sub.CMD USING 3 ERROR 0
>     GOTO lEnd
>   ENDIF
>
> -- -----------------------------------------------------------------------
----
> -- Create new database:
> -- -----------------------------------------------------------------------
----
>   INPUT &vDBtoReload
> -- Access violation at address 0101A515 in module 'RBENGINE.DLL'. Read of
> address FFFFFFFF
> -- Apparently fails after the last command in the file before returning
here.
>   SET VAR vError = .vErrVar
>   DISCONNECT
>   IF vError <> 0 THEN
>     DISCONNECT
>     SET VAR vMessage = ('Error loading data to new database:' &
.vDBtoReload)
>     SET VAR vCaption = 'ERROR!'
>     RUN D:\DBCOPY\SOURCE\MultiDat\Pause_Sub.CMD USING 3 ERROR 0
>     GOTO lEnd
>   ENDIF
>
>   SET VAR vMessage = (.vCurrDB_Name & 'Database created successfully')
>   SET VAR vCaption = 'Multi-Database Reload:'
>   RUN D:\DBCOPY\SOURCE\MultiDat\Pause_Sub.CMD USING 0 INFO 3
>   CLS
> ENDWHILE
>
> SET ERROR MESSAGES OFF
> GOTO lSkip
> RETURN
>
> LABEL lEnd
> SET VAR vMessage = ('Error Encountered:' & .vMessage)
> SET VAR vCaption = 'ERROR!'
> SET VAR vButton  = 'Continue...'
> RUN D:\DBCOPY\SOURCE\MultiDat\Pause_Sub.CMD USING 1 ERROR 0
> SET VAR vButton  = 'Press any key to exit...'
> RUN D:\DBCOPY\SOURCE\MultiDat\Pause_Sub.CMD USING 1 ERROR 0
> EXIT
>
> LABEL lSkip
> DISCONNECT
> SET VAR vFirstRun = 'Yes'
> SET VAR vMessage  = 'All reloads successful!'
> SET VAR vCaption  = 'Multi-Database Reload:'
> SET VAR vButton   = 'Press any key to continue...'
> RUN D:\DBCOPY\SOURCE\MultiDat\Pause_Sub.CMD USING 1 INFO 0
> QUIT TO D:\DBFILES\MULTIDAT\v7_MultiDat.APP
> RETURN
> *( End of program )
>
> Thanks in advance for any insights,
> Regards,
> Alastair.
>
> ----------------------------------
> A D B Burr,
> St. Albans, UK.
> ----------------------------------
> [EMAIL PROTECTED]
> ----------------------------------
>

Reply via email to