Page 3 of 3 FirstFirst 123
Results 31 to 44 of 44
  1. #31
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    So the function I created to manage the different object types does not call on the special function in the case the object type is acTable or 0. There would have to be an If Then else statement or something added to the custom function I create to call the special function that supposedely manages the import process for tables in the event intObject = 0.

  2. #32
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Thanks for trying to help. Can you Please see if it would work like that. Its late mid night here I gotta go for now. be back after a nap
    Have a nice time.

  3. #33
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Quote Originally Posted by aspen View Post
    Thanks for trying to help. Can you Please see if it would work like that. Its late mid night here I gotta go for now. be back after a nap
    Have a nice time.
    I tried it a couple of ways but not yet working for me

  4. #34
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    It helps if you show us what you tried. If I do not know what you are thinking, or considering, or have already considered, communication will be difficult.

  5. #35
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Code:
    If Me.optObjType.Value = 0 Then
    'MsgBox "Please select an Object type."
    'Exit Sub
     Application.LoadFromText intObject, strObjName, strFilePath
    End If
    Hi ItsMe I tried this.
    AND I CREATED A SEPERATE BUTTON and put that code without if and presed it after selecting folder and table. Well to be honest there is too much coding for me to understand well. Can you please tell which function to call if its a table. may be then I can guess.
    Thanks a lot ItsMe

  6. #36
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Now I am trying this still error. I gues this is closer
    Call LoadFilesFromText(strPath)

  7. #37
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    When I select The data base folder and use this function. nothing happens. But when I select the folder where the tables are I get this error
    Attached Thumbnails Attached Thumbnails Untitled.png  

  8. #38
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    OK, let me take a look at the other function and see if it has any merit. I am thinking use something like the code in post#35 to call the other public function that you linked to earlier and that is in the Standard Module already.

  9. #39
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I do not see any code to import a new table from the text file that is created from the custom function.

    Consider the following

    Code:
        'SaveAsText does not work for tables - Use custom Function
        strTablesPath = strPath 'Do not Delete this - strPath is changed by PAWTablesDocument
        If Not PAWTablesDocument(strTablesPath) Then
            MsgBox "There was an error documenting the Tables.", vbCritical
        End If
    Docmd does not export the table defs and their properties, a custom function does that using DAO to retrieve the properties and format the retrieved data into its own version of a text file.

    In order to create a table based on this text file you would have to read it line by line and use a technique, similar to the export technique, to create a table based on the definitions contained in the text file.

  10. #40
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Hi Its me I just fund this. May be something like this. I'll try and let you know
    http://answers.microsoft.com/en-us/o...4-67e9913289a1
    Thanks

  11. #41
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    In order for that to work you will need a stored (saved) export procedure and import procedure. Some of the table's properties may not get transferred. The stored procedure has to be in the database doing the work. You can import the stored procedure using the advanced features of the import wizard.

  12. #42
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Hi Its me. May be Is better to Backup the Tables to Mdb database as tables. We can Export and import other objects as text files. That way its faster and safer. I guess That's why we don't see a lot about importing tables as text files

  13. #43
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You could do what the Custom Function for exporting tables does and do it in reverse, reading from the text file and creating table defs, using DAO to adjust properties, etc. It is a lot of code. Importing tables using the Wizard and maybe saving the procedure would probably be best. Just remember that MDB tables do not have all the functions/properties that are available in accdb files.

  14. #44
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    You are right ItsMe. I have alredy changed the export from mdb to accdb. And I am thinking of automating the procedure of Export tables as accdb and expoert other objects as textfiles and importing them when ever I need.

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Can't save database objects when changes made
    By stanley721 in forum Access
    Replies: 8
    Last Post: 10-12-2015, 08:51 PM
  2. FileDialog pass starting Folder as a variable
    By bbrazeau in forum Programming
    Replies: 3
    Last Post: 09-13-2013, 07:23 AM
  3. Get objects selected in the database window
    By jptros in forum Programming
    Replies: 2
    Last Post: 08-02-2012, 04:39 PM
  4. Replies: 5
    Last Post: 05-17-2012, 06:23 PM
  5. Cannot import objects from secured database
    By focosi in forum Security
    Replies: 2
    Last Post: 09-10-2011, 02:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums