How To Rebuild Objects From Text Files?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Martin

    #16
    Re: How To Rebuild Objects From Text Files?

    I encountered the same error trying to export/import an MDB as text:

    Error 2205 (Database Name) can't create the output file.

    I was using the same posted code. The error occurred at the same place as
    Wayne's attempt: app.LoadFromTex t acForm, Name, FileName

    Same error was thrown for reports as for forms, however qry defs and
    modules re-loaded without error. Wayne wondered if the error related to
    compatibility between versions (a converted Access 2000 database). Mine
    was a converted Access 2000 database as well, so I did some experimenting.

    Starting from scratch, I converted the Access 2000 mdb to Access 2003
    using the 'Convert Database' menu tool. The resulting database
    consistently threw error 2205 with this code.

    I then created a new (empty) 2003 mdb and imported all objects from the
    original mdb. The resulting database was error-free when running the text
    export/import code.

    This confirms that the problem likely relates to non-native 2003 databases
    (converted from Access 2000). Apparently when Access imports objects from
    A2000 into A2003 it creates 'pure' A2003 objects, whereas the 'Convert
    Database' menu tool yields some obscure differences.

    FWIW, I have included below (after the quoted text from Wayne) the 2 text
    files from the same (simple) form, (1) exported from the
    A2000-converted-to-A2003, and (2) exported from the native A2003 version.
    There are 2 lines in the native 2003 version which are not in the
    converted version:

    ---------------
    GUID = Begin
    0x8b8505f89b289 04d82001a842a85 0a56
    End
    NameMap = Begin
    0x0acc0e5500000 000000000000000 000000000000000 000000c00000002 000000,
    0x0000000000000 000000000000000
    End
    ---------------

    I am unsure if these lines might be related to the error, but in general
    my results suggest that importing all objects into a new 2003 database is
    a better strategy for conversion than using Access' menu tool, at least
    for text export/import functionality, but perhaps for other (hidden)
    functionality as well.

    One other note. My mdb had a reference to a local MDE code library. The
    referenced MDE was created in Access 2000, so I originally suspected this
    lib ref. was the culprit. However, using the imported (native 2003)
    database, there was no error with or without the Access 2000 MDE lib ref.
    Using the converted version, the error was consistently thrown, with or
    without the reference.

    Chris

    --
    Chris Martin
    UNC-CH


    On Sun, 18 May 2008, Wayne wrote:
    On May 19, 1:51 am, lyle fairfield <lyle.fairfi... @gmail.comwrote :
    >
    >A little further search brings up this error described but no
    >suggestion as to its cause or cure. If you were to post the text file
    >for the first form that fails, some of us might see if we can load the
    >form into a database with the LoadFromText method. If so, we will know
    >its not your form. If not, we might be able to study the problem in
    >general terms, (or you could just send me the text file and I'll post
    >it: lyle dot fairfield at gmail dot com).- Hide quoted text -
    >
    After a few hours of experimentation I've made a few observations.
    The DB I am working with is an A2003 database, but I have a sneaking
    suspicion that it is one that I have converted from A2000. Not sure
    if this has any bearing on anything but I imported all of the objects
    into a new A2003 database and tried running the code again. It
    partially worked this time. As before, all the objects were saved as
    text, but this time some of the forms were imported from the text
    files before it fell over. I then tried importing some of the forms
    that were missed on the import one by one by using the LoadFromText
    method and this worked. This seems to indicate that there is nothing
    inherently wrong with the forms. When I view the forms they look and
    work fine.
    >
    The scenario is the same on a couple of other databases that I tried
    running the code on. Some of the forms will import, then the code
    fails. I'm 99% sure that these are native A2003 databases and haven't
    been converted from an earlier version. As to why the original code is
    failing and not importing all the objects, I don't know. It may well
    remain a mystery of the ages. At least now I know that in a worst
    case scenario if I ever have to use this, I can export all the objects
    to text using the original code and then use the LoadFromText method
    to import them all one by one. Quite laborious, but it would work.
    >
    I intend to experiment with this further when I have a bit more time
    on my hands and will post if I get to the root of the problem.

    -----------------------
    form from Access 2000 converted to Access 2003
    -----------------------
    Version =20
    VersionRequired =20
    Checksum =1319579709
    Begin Form
    AutoResize = NotDefault
    RecordSelectors = NotDefault
    NavigationButto ns = NotDefault
    DividingLines = NotDefault
    DefaultView =0
    ScrollBars =0
    TabularFamily =0
    BorderStyle =3
    PictureAlignmen t =2
    DatasheetGridli nesBehavior =3
    GridX =24
    GridY =24
    DatasheetFontHe ight =10
    Left =270
    Top =210
    Right =8910
    Bottom =4530
    DatasheetGridli nesColor =12632256
    RecSrcDt = Begin
    0x805fd4ecd754e 340
    End
    Caption ="Form not ready"
    DatasheetFontNa me ="Arial"
    Begin
    Begin Label
    BackStyle =0
    FontName ="Tahoma"
    End
    Begin CommandButton
    FontSize =8
    FontWeight =400
    ForeColor =-2147483630
    FontName ="Tahoma"
    End
    Begin Section
    Height =2880
    BackColor =-2147483633
    Name ="Detail"
    GUID = Begin
    0xa45a656675e46 f489f624edcd2db e040
    End
    Begin
    Begin Label
    OverlapFlags =85
    TextAlign =2
    Width =5580
    Height =600
    FontSize =16
    Name ="Label0"
    Caption ="Form not ready."
    GUID = Begin
    0xc096deb6ece8a e41af262a11be30 cb7e
    End
    End
    Begin CommandButton
    OverlapFlags =85
    Left =2100
    Top =1140
    Width =1035
    Height =405
    Name ="cmdClose"
    Caption ="Close"
    OnClick ="[Event Procedure]"
    GUID = Begin
    0x663bfb42d6a6f 246a33b57112e84 0d45
    End
    End
    End
    End
    End
    End
    CodeBehindForm
    Attribute VB_GlobalNameSp ace = False
    Attribute VB_Creatable = True
    Attribute VB_PredeclaredI d = True
    Attribute VB_Exposed = False
    Option Compare Database
    Option Explicit


    Private Sub cmdClose_Click( )
    On Error GoTo Err_cmdClose_Cl ick


    DoCmd.Close

    Exit_cmdClose_C lick:
    Exit Sub

    Err_cmdClose_Cl ick:
    MsgBox err.Description
    Resume Exit_cmdClose_C lick

    End Sub
    -----------------------
    -----------------------
    -----------------------


    -----------------------
    form from Access 2003 imported from Access 2000
    -----------------------
    Version =20
    VersionRequired =20
    Checksum =-416531212
    Begin Form
    AutoResize = NotDefault
    RecordSelectors = NotDefault
    NavigationButto ns = NotDefault
    DividingLines = NotDefault
    DefaultView =0
    ScrollBars =0
    TabularFamily =0
    BorderStyle =3
    PictureAlignmen t =2
    DatasheetGridli nesBehavior =3
    GridX =24
    GridY =24
    DatasheetFontHe ight =10
    Left =270
    Top =210
    Right =8910
    Bottom =4530
    DatasheetGridli nesColor =12632256
    RecSrcDt = Begin
    0x805fd4ecd754e 340
    End
    GUID = Begin
    0x8b8505f89b289 04d82001a842a85 0a56
    End
    NameMap = Begin
    0x0acc0e5500000 000000000000000 000000000000000 000000c00000002 000000
    ,
    0x0000000000000 000000000000000
    End
    Caption ="Form not ready"
    DatasheetFontNa me ="Arial"
    Begin
    Begin Label
    BackStyle =0
    FontName ="Tahoma"
    End
    Begin CommandButton
    FontSize =8
    FontWeight =400
    ForeColor =-2147483630
    FontName ="Tahoma"
    End
    Begin Section
    Height =2880
    BackColor =-2147483633
    Name ="Detail"
    GUID = Begin
    0xb7565ebe5f29f 74c92a186f19a1e 8405
    End
    Begin
    Begin Label
    OverlapFlags =85
    TextAlign =2
    Width =5580
    Height =600
    FontSize =16
    Name ="Label0"
    Caption ="Form not ready."
    GUID = Begin
    0x5e6a4c00564df c4d90ae25a2e161 fb30
    End
    End
    Begin CommandButton
    OverlapFlags =85
    Left =2100
    Top =1140
    Width =1035
    Height =405
    Name ="cmdClose"
    Caption ="Close"
    OnClick ="[Event Procedure]"
    GUID = Begin
    0x0b9721ce18424 949a07184307590 3f42
    End
    End
    End
    End
    End
    End
    CodeBehindForm
    Attribute VB_GlobalNameSp ace = False
    Attribute VB_Creatable = True
    Attribute VB_PredeclaredI d = True
    Attribute VB_Exposed = False
    Option Compare Database
    Option Explicit


    Private Sub cmdClose_Click( )
    On Error GoTo Err_cmdClose_Cl ick


    DoCmd.Close

    Exit_cmdClose_C lick:
    Exit Sub

    Err_cmdClose_Cl ick:
    MsgBox Err.Description
    Resume Exit_cmdClose_C lick

    End Sub



    Comment

    • Wayne

      #17
      Re: How To Rebuild Objects From Text Files?

      On May 23, 11:26 pm, Chris Martin <nr.cmartin.dfg h....@med.unc.e du>
      wrote:
      I encountered the same error trying to export/import an MDB as text:
      >
          Error 2205 (Database Name) can't create the output file.
      >
      I was using the same posted code. The error occurred at the same place as
      Wayne's attempt:  app.LoadFromTex t acForm, Name, FileName
      >
      Same error was thrown for reports as for forms, however qry defs and
      modules re-loaded without error. Wayne wondered if the error related to
      compatibility between versions (a converted Access 2000 database). Mine
      was a converted Access 2000 database as well, so I did some experimenting.
      >
      Starting from scratch, I converted the Access 2000 mdb to Access 2003
      using the 'Convert Database' menu tool. The resulting database
      consistently threw error 2205 with this code.
      >
      I then created a new (empty) 2003 mdb and imported all objects from the
      original mdb. The resulting database was error-free when running the text
      export/import code.
      >
      This confirms that the problem likely relates to non-native 2003 databases
      (converted from Access 2000). Apparently when Access imports objects from
      A2000 into A2003 it creates 'pure' A2003 objects, whereas the 'Convert
      Database' menu tool yields some obscure differences.
      >
      FWIW, I have included below (after the quoted text from Wayne) the 2 text
      files from the same (simple) form, (1) exported from the
      A2000-converted-to-A2003, and (2) exported from the native A2003 version.
      There are 2 lines in the native 2003 version which are not in the
      converted version:
      Thanks for the reply (and detective work) Chris. I'll import all
      objects into a new A2003 database and see how it goes.

      Comment

      Working...