Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 44
  1. #16
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Thanks a Lot Its me. Glad you are interested in textfiles import cause I encountered a little error in calling the function. http://gainingaccess.net/GainingAcce...SaveAsText.htm
    I am switching to this code to export them. Calling the export function is easy and all exports done success fully - Call SaveDBAsText("C:\Users\Shiham\Desktop\New\Import")
    But Call LoadFilesFromText("C:\Users\Shiham\Desktop\New\Imp ort\Imported-accdb_2014-03-23-21-16\Forms", True) is giving me errors. because there is something optional subfolders and I think I am not calling it right. The code is all in one like. can you test it and see If it works for you. and please come back to tell me how you call the load files function.


    Thanks a lot

  2. #17
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    OK then, I will take a look at it. The functions I mentioned earlier were probably going after the subfolders. I will look at it a little later.

  3. #18
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Thanks a lot ItsMe. Its great and simple. Glad you got interested in textexport. This is a best all in one code for that.http://gainingaccess.net/GainingAcce...SaveAsText.htm
    But I am getting aerror in calling the load from function. I am calling the export function all righ and it works. But the Load from has too parameters folder and option. so I am confused. Call LoadFilesFromText("C:\Users\Shiham\Desktop\New\Imp ort\Imported-accdb_2014-03-23-21-16\Forms", True). I have called many different ways can you please try it .Please come back to let me know how you called the load from part
    Thanks a lot ItsMe. have a nice time

  4. #19
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I took a look at it and from the start decided to have user interaction manually go after the subfolders that contain the different object types, running a separate procedure for each object type. Then I found an issue with the function LoadFilesFromText. I created a new function to manage the import process and discovered that there are a few issues with the original function.

    Long story short, my approach to define the object type, ie form, before launching the procedure to import is pivotal. I should have a working model to import soon. This model could then be expanded to automate the process for all object types by selecting a single DB to import.

  5. #20
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    This DB has two forms and a standard mod. I copied all of the functions from the code you linked to into the module. As I mentioned, there are a few issues with one of the functions you linked to. The solution provided here uses a new function to import the objects. The user tells what type of object is being imported by selecting an option group.

    The two forms are for exporting and importing. Because this is only a step towards full automation, the steps are segregated by multiple routines/controls. Hopefully, the sample is not too buggy.
    Attached Files Attached Files

  6. #21
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Hi Its me Thanks a lot For this. that form is clean and perfect. Nice work. The export procedure works well. But There seem to be a bit of problem in the import prosses yet. The filesystem object. So I went to tools reference and selected Microsoft Scripting Runtime library in design view. Now I get the runtime error 5. Invalid procedure or argument and
    this line is high lighted Set objFolder = fsoFile.GetFolder(strPath).

  7. #22
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Sorry about that. After I was done creating the forms I imported the objects to a new DB, forgetting to add the references. So you will also need the Office reference too.

    Microsoft Office XX.X Object Library
    Microsoft Scripting Runtime

    When you get to the table objects, code may have to be added to manage this object type.

  8. #23
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Yeah I created a test table and exported it. And trying to import it back. So which code is needed to get the import table working? Thanks a lot for this

  9. #24
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Are you saying that the sample works for all objects except for tables and you have a basic understanding of how the code works?

  10. #25
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    No First I tried importing a table. I have never worked with scripting run time and I now found that same error happens for forms too

  11. #26
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I added the references and was able to get it to work. One tricky thing is importing the file for the form that is currently open. So after you export, you need to rename or delete the text file for frmImportStuff.

    I added some objects to this DB for testing purposes.

    .
    Attached Files Attached Files

  12. #27
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Hi Its me. Its the same. Still some errors. Please re test and see
    Thanks
    Attached Thumbnails Attached Thumbnails Untitled.png   Untitled2.png  

  13. #28
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I downloaded the DB

    Used the form to export the objects
    Deleted the text file for the Import Form
    Used the form to Import the Objects

    No problem

    When you use the form to import the objects, you only select the folder that has the name of the DB, not the subfolders that contain the various objects.

    When you click the button that says "Select Folder Destination" you follow the msgbox prompt that stays to only select the folder with the DB name

    The act of selecting the Object type from the option group will concatenate the appropriate subfolder for said object to strPath.

  14. #29
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Thanks Its me. It Me I should have read the instructions well. Now it works for form. But still Not working for tables. Did you test it for tables too?

  15. #30
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    For table its error 5 invalid procedure or argument
    Attached Thumbnails Attached Thumbnails Untitled.png  

Page 2 of 3 FirstFirst 123 LastLast
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