[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== Attaching Archived Volumes (OpenInsight 32-bit Specific) ==== === At 13 SEP 2004 09:02:55PM Andrew Gunner wrote: === {{tag>"OpenInsight 32-bit Specific"}} Hi all I have created some archived volumes for a client which a direct copies of the live system with the data removed. I now need to be able to attach these volumes so that the client can report on them. I have tried using Detach_volume to detach the live and Attach_table to attach the achive. Which works fine the problem is when I attempt to either go to a different archive or return to the live system. The detach and attach do not work even though no error is reported. Any Ideas ? Thanks Andrew ---- === At 14 SEP 2004 08:09AM Colin Rule wrote: === Because it is a copy of the database, the date/time stamps are the same and it cannot attach multiple databases with the same details. Try this to resolve, as a once off process. attach REVMEDIA OPEN "REVMEDIA" TO REVMEDIA THEN WRITEV TIMEDATE() ON REVMEDIA,"%%REVMEDIA%%",2 ELSE NULL END ---- === At 14 SEP 2004 10:03PM Andrew Gunner wrote: === Thanks I will try it Regards Andrew ---- === At 17 SEP 2004 01:04AM Andrew Gunner wrote: === I tried your suggestion but no joy it still performs the first detach attach sequence fine and not the second or subsequent tries. Andrew ---- === At 18 SEP 2004 02:08AM Richard Bright wrote: === After you do the detach, you might want to flush cache etc. Richard Bright BrightIdeas New Zealand ---- === At 20 SEP 2004 03:06AM Andrew Gunner wrote: === I didn't know there was a cache how do we flush it. Andrew ---- === At 20 SEP 2004 07:32PM Paul Rule wrote: === Andrew, Hows things? You aren't doing a setalias to any of those files are you? Have you done a get_status after the attempted detach to check for any errors? ---- === At 21 SEP 2004 11:38PM Andrew Gunner wrote: === Fine thanks No set alias and the status is fine Andrew ---- === At 24 SEP 2004 06:24PM Richard Bright wrote: === OK, Here is to snipits of code that might be useful. Note the flush and garbage collect. The Archive vol has been tweaked as prev mentioned to ensure the timestamp is different, elsewise it is a clone of the original volume. /* to find whats attached */ * Compile list of current volumes attached Vol_List='; Vols=' Vol_List=@Volumes For M=1 to Count(Vol_List,@FM) + 1 Test=Vol_List If Test1,'F*'=RTP57' then Vols := Field(Test,'*',2):@fm end next M If Index(Vols,@fm,1) then Vols-1,1=' /* To detach and attach archive Vol */ * First detach current_Volume to be sure Set_Status=0 ; * Make sure status clear Detach_Volume(Current_Volume) If Get_Status(Status_Code) then NewVol=Current_Volume GoSub Error_Processing Ret= 0 Return End * Now flush cache - important Flush GarbageCollect * Now attach selected volume - all tables Set_Status=0 ; * Make sure status clear ATTACH_TABLE(Volume,'',AppName,'') If Get_Status(Status_Code) then NewVol=Volume GoSub Error_Processing * etc End [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=370EF686AF0D11B285256F0F0005C2D0|View this thread on the forum...]]