Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Attach_Table

Code looks something like this, with Table_Names set to an @FM delimited list of tables. And the directory contains a bunch of rev files. Files where originally attached in a different location and copied to this buffer directory where they are then re-attached.

Dir_Name = "C:\Users\jimva\AppData\Local\Temp\TACTIC_BUFFER\5\"
Call Attach_Table(Dir_Name, Table_Names, "", "")

Tables are not attached Status() returns zero. This code works fine in OI 9.4 is something different in OI10?

«1

Comments

  • Could the DataBase name be diferent from the app you are in.

    Try attaching via the dataBase manager in the IDE and see if you get a response
  • Jim - Are you using the UD Service to manage these volumes? If not, do you have a revparam file in these volumes? My theory is that the answer is no to both questions. The UD client that runs in OI10 assumes volumes are managed by the service by default, whereas the UD client for OI9 - at least the UD 4.7 client - did not.

    If this matches your situation, create a revparam file with a ServerOnly=0 line.
  • edited May 21
    Not using UD.
    The files are originaly attached in c:\oi10\data\base\ and show up in the tool panel database as tables.
    All the following is done in RBasic.
    I then deatch the files. They no longer show up in tool panel database.
    Copy them to a new loaction and attach them. They do not attach and I can not open them.
    They do not show up in tool panel database.
    I do not have a revparam file, adding one had no effect.
  • I can remove the old volume and add the new one via database manager.
  • As an experiment try:

    Call Attach_Table(Dir_Name, "", "", "")

    and also doing:

    loop through the Table_Names and attach individually

    Note:
    Ensure that Table_Names are @fm delimited

    If that works, then report the issue in the Rev Issue tracker.
  • I don't understand the difference between this:

    I then deatch the files. They no longer show up in tool panel database.
    Copy them to a new loaction and attach them. They do not attach and I can not open them.
    They do not show up in tool panel database.


    and this...

    I can remove the old volume and add the new one via database manager.


    They are effectively the same operation, but with different results. What am I misunderstanding?
  • edited May 21
    I agree they should be the exact same thing, but one works and the other does not.
    One is all RBasic, the other all in database manager.
  • Btw this code that doesn't work in OI10 works fine in OI9.4
  • edited May 21
    I will see what happens if I do the tables individually. And with a null parameter.
    Thanks for the suggestions, it helps a lot.
  • edited May 22
    I have done some testing and it appears to be a bug in OI10 where you DO NEED the DBID
  • Interesting. I am beginning to agree with Barry's assessment, but I'm rather surprised I haven't seen this in other OI10 systems as of yet. Just out of curiosity, which version of OI10?

    Also, did you check Get_Status() or @FIle_Status get see what error is returned? That might help confirm what is going on.

    One last item: confirming if Attach_Table is called in a specific way using the IDE is a perfect use case for Hooking. This will reveal exactly how the arguments are populated.
  • Just out of curiosity, which version of OI10?

    For me OI10.2.4
  • edited May 22
    Get_Status() returned 1.
  • I tried:
    Call Attach_Table(Dir_Name, Table_Names, "W_TACTIC", "")
    It still didn't work.
  • Following also does not work

    Subroutine Test_Jim(Null)

    Gosub Get_Table_Names

    Call Detach_Table(Table_Names)

    Dir_Name = "C:\Users\jimva\AppData\Local\Temp\TACTIC_BUFFER\1"
    Num_Tables = FieldCount(Table_Names, @FM)
    For x = 1 To Num_Tables
    Call Attach_Table(Dir_Name, Table_Names, "W_TACTIC", "")
    Next x
    Return
  • I've been traveling so I've had limited opportunity to test anything on my own. I'll try to investigate further soon.

    Jim - are your tables a member of the W_TACTIC database? I'm just confirming because it is not uncommon for an application to work with tables that are technically a member another database, like SYSPROG or GLOBAL.

    Also, based on all that you've already experienced, I would assume that if you detached the "c:\oi10\data\base\" volume and then tried to use Attach_Table to attach those same tables, it will fail. Have you tried that to confirm?
  • I managed to find some time to test this while waiting in the airport. Oddly enough, I can't get this to NOT work for me. Even if I force in an incorrect database, it seems to attach my tables. There must be something different with what we are doing, but I am not sure what that is.

    Did @File_Error stay clean for you as well? I don't think you reported back on that. (Previously I wrote @File_Status, but that was a typo.)
  • edited May 22
    I can attach the files in the original location but not the copied ones. Bizzare maybe it's the location in the Windows %Temp% directory.
    Let me experiment.
  • edited May 22
    I just recompiled the code that copies the files. I added a debug, changed my mind and deleted the debug. Now like magic it's working I have no idea what I did to fix it.

    Edit: It didn't fix it. It's now not detaching the original tables.

    So just to reiterate, I used Detach_Table and it worked, I then used Attach_Table on the same location, and it worked. I then ran Detach_Table and it failed.

    BTW I have byte compared the rev files and the two sets of files are identical.
  • >> are your tables a member of the W_TACTIC database<<
    The database ID is W_TACTIC, how would I tell if the tables are members of this database. They are attached when I open OI.
  • Thanks Barry, yes they show up under that menu.
  • @DonBakke
    Are you using 10.2.3 because I have a similar issue in 10.2.4 but not 10.2.3
  • I am using 10.2.4
  • I guess I need to report this as a bug. How do I do that nowadays?
  • Thanks Barry.
  • My issue is that I think they might have plugged a loophole (which they have done a lot of in Oi10)

    in Oi9 thru to Oi10.2.3 I could use attach_table to attach tables from a copy of a folder (volume) that is already attached (If done via IDE you get the FS404 error - duplicate voulume names)
    Now in OI10.2.4 you DO get that error.
  • Jim, you said you did not get a status error which in my case was 404.
    So your volume names ARE different?
Sign In or Register to comment.