开发者

MS Access Copy Table Structure Only

I have a number of Linked (ODBC) tables in my MSAccess DB.

I what I want to do is create a copy of each table (preferably the Structure Only).

ive tried,

DoCmd.CopyObject , "NewTableName", acTable, "SourceTableName"

DoCmd.TransferDatabase acImport, "Microsoft Access", _
  SrcDatabase, acTable, SrcTable, DstTable, StructureOnly

but 开发者_高级运维these just seem to make a copy of the linked table.


think ive got it sorted, but ill leave it open incase someone has a better solution,

 DoCmd.RunSQL ("Drop Table [LocalTable]")
 DoCmd.RunSQL ("SELECT * INTO [LocalTable] FROM  [ODBCTable];")


Had the same problem. Found out that the "DoCmd.Transferdatabase" worked, but had to use "1" instead of the keyword "True". And if the source table is a linked table the destination table appears as linked as well (with the arrow in the table list), although it really is in the local database.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜