SaveAsText For Table Structure?

  • Thread starter Thread starter TC
  • Start date Start date
T

TC

John said:
Hello,
I am using SaveAsText to save my froms, reports, etc...

This works for a query;
Application.Saveastext acQuery, "Query1", "F:\Query1.txt"

But this doesn't work for a table.
Application.Saveastext acTable, "tblMyObjects", "F:\tblMyobjects.txt"

I get the following error:
"The object type argument for the action or method is blank or invalid"

Am I not able to Export the table structure to a txt file as I can for other
Objects.

Correct - it does not work for tables.

Any Ideas?

Have you tried the database documenter (somewhere in the tools menu)?

HTH,
TC
 
John said:
Thanks for the answer,
But I must say, it's rather discouraging. I'm trying to do it
programatically.
I can do it for every other object but Tables?
I think it's absurd that you can save all the details of a Form , Report,
etc.
including it's code to a text file. But you can't save a table
structure?????
Why would MS not allow this?

For the simple reason that saveastext & loadfrom text are undocumented
internal methods! You are lucky that you can use them at all. I imagine that
they were added for the (undocumented) use of external, version-control
applications. I also imagine that in principle, they could change, or
disappear completely, in any future version of Access! So I hope you are not
using them for critical features of your application :-)

HTH,
TC
 
Hello,
I am using SaveAsText to save my froms, reports, etc...

This works for a query;
Application.Saveastext acQuery, "Query1", "F:\Query1.txt"

But this doesn't work for a table.
Application.Saveastext acTable, "tblMyObjects", "F:\tblMyobjects.txt"

I get the following error:
"The object type argument for the action or method is blank or invalid"

Am I not able to Export the table structure to a txt file as I can for other
Objects.
Any Ideas?
 
Thanks for the answer,
But I must say, it's rather discouraging. I'm trying to do it
programatically.
I can do it for every other object but Tables?
I think it's absurd that you can save all the details of a Form , Report,
etc.
including it's code to a text file. But you can't save a table
structure?????
Why would MS not allow this?
Anyway.....just my little rant. I've been working on this little program
for over two weeks. I guess I should've checked the table functionality
first
instead of last.
I guess that's what you get for trying a non documented funtion.
Thanks anywy
 
John said:
Thanks for the answer,
But I must say, it's rather discouraging. I'm trying to do it
programatically.
I can do it for every other object but Tables?
I think it's absurd that you can save all the details of a Form ,
Report, etc.
including it's code to a text file. But you can't save a table
structure?????
Why would MS not allow this?
Anyway.....just my little rant. I've been working on this little
program for over two weeks. I guess I should've checked the table
functionality first
instead of last.
I guess that's what you get for trying a non documented funtion.
Thanks anywy

I don't see anything preventing you from using DAO methods to extract
and write a detailed description of a TableDef, such that you could
recreate it later.
 
Back
Top