I was fiddling w/ a database, and happened to not have a project hanging immediately over my head — so had the time to outline some anomalous behavior that occured. I have no questions, the problem is resolved — I merely post this for the curiosity:
Synopsis:
DoCmd.RunSQL “SELECT ReturnedAddresses.* INTO ZZ_Backup_” & Format(Date, “mm-dd-yyyy”) & ” FROM ReturnedAddresses;”
Failed in Access 97 on Win2k machine w/ “3067: Query input must contain at least one table or query.”
Initially, the “ReturnedAddresses” table was “[Returned Addresses List]”.
A search on that error yielded that the VISDATA add-in that doesn’t like the brackets, which are required if the table name has spaces. I searched for any VISDATA components on _my_ machine, and did not find any. (Plus, removing the brackets to the table name would have avoided the bug.)
I don’t like spaces anyway, so I took the liberty of renaming the table (it was not mine) and removed the brackets. Still, no go. It did not run.
I changed date to now(), changed format$ vs format, removed the “Backup” from the “into” name.
I closed, reopened Access, and rebooted, it did not run.
I opened another ’97 database on the 2000 machine, which had a similar function, and it ran like a charm.
I opened yet another ’97 database on the 2000 machine and built the code that was identical, and it did not run.
I checked the lib references, and they were the same on all three databases.*
I took a deep breath, and, while on the 2000 machine, recompiled and saved all in the database where the code was working, and it still worked after (I realize that this might not have been enough,from some vague memory of comments made here in the Lounge).
I went over to my ’95 machine, and created a new form in the problem database, created the code, and everything worked!
I moved to my 2000 machine, and ran the code in the new form w/out a hitch.
Additionally on the 2000 machine, I then created a new button w/ a similar string in the new form, and everything worked.
I discounted that the form was corrupted or that Access kept a reference to the earlier table name somehow, because of testing w/ the other database on the 2000 machine — but, I probably should have tried to run or edit the self-same form while on the ’95 machine to be a purist.
Anyone have a clue? (Oops — I said that I had no questions — I really do not, but … I am still curious and wonder if there is any known thing that could explain this flukiness.
*(The VBA332.dll on the 2000 machine showed as “3.0.0.7019”, while the vba332.dll on the ’95 machine showed as “3.0.7019”, fwiw — but the both had the same dates. The MSACC8.olb was the same. The DAO on all was 3.51 (dao350.dll of 4-1998). Additionally, a DAO360 was available on the 2000 machine.)