-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportAllSource fails for objects other than modules #12
Comments
The failure of the LoadFromText method is known see http://stackoverflow.com/questions/208397/loadfromtext-gives-error-2285-microsoft-office-access-cant-create-the-output-f Think that the first change to the project should be to add some error handling that can jump over objects that cannot be imported and which logs the failed imports. |
I got the code working and can now export all form, report, macro and modules and re-import them into a new database and regenerate the whole application. For some reason the queries did not import and the tables have to be brought over manually anyway. I am using ms-access 2010 and Git Extensions. For some reason, queries did not import but I will work on that. From other experience, the queries are evaluated when imported and this will fail if tables are not imported first. The exported query code looks good so the query code is not likely to be the issue. Note also that some small issues are such as forms not linking properly to their class modules also occur, but these are easily ironed out. Compile the application and compact and repair it. Relinking class modules can be triggered by opening and event procedure and typing in a space on an empty line or any other edit and then compiling. |
One critical line of code need to be inserted into the Sanitise text files procedure. The fixed procedure is below. The problem is that some lines with the word BEGIN are skipped by the original procedure. The inserted lines are flagged with the following comment, "' This line needs to be added" ' For each *.txt in
End Sub |
I added some code which stores table structures and re-imports them almost loss free (some relational cascading stuff has to be fixed manually). The exported files are SQL. Hope it is going to be pulled. |
Hi ArminBra, Cheers, Andrew |
Thank you for your very kind reply. Wouldn't have come so far without your basis. |
I have exported one my existing projects and then tried to re-import it into an empty project. The ImportObject sub fails at this line [Application.LoadFromText obj_type_num, obj_name, TempFile()]. I modified the sub to report the error and resume next and a list of files is created reporting the errors. The errors look like
[Microsoft Access encountered an error while importing the object 'ChargeOutRate'.
Error encountered at line 4.
Expected: End of file. Found: Name.]
If I hardwire the Application.LoadfromText method with attributes, then I get "Microsoft Access cannot create the output file" which is confusing when one is trying to import.
The text was updated successfully, but these errors were encountered: