# 再试试看

Posted by Scott on June 08, 1999 at 18:38:22:

In Reply to: Re: 再次请教Scott Lee posted by 皮皮 on June 08, 1999 at 17:25:52:

: 请问Scott Lee

: Set Database = DBEngine.Workspaces(0).OpenDatabase("c:\plus", False, False, "text;hdr=no/yes")
: Set Recordset = Database.OpenRecordset("score2")
: Set Database = DBEngine.Workspaces(0).OpenDatabase("c:\plus\kk.MDB")
: Set td = Database.CreateTableDef("temp")
: td.Connect = "text;HDR=No/Yes;database=c:\plus\kk.mdb"
: td.SourceName = "score2"
: 请问为何RUN 至此
: 出现'物件不支援此属性或方法
: Database.TableDefs.Append td

:
: : 谢谢您:

皮皮
请你将以下的程式copy至你的程式中
1.专案/设定引用项目/Microsoft DAO 3.51 Library(选取)
2.Check你的文字档旁有否schema.ini档
[score2]
format=fixedlength
col1=a char width 8
col2=b char width 2
col3=c char width 4
col4=d char width 2
col5=e char width 16
col6=f char width 2
col7=g char width 4
col8=h char width 35
以上之a~h为栏位名称
3.<程式部份>
option explicit
dim db as database,rs as recordset,td as tabledef

private sub commond1_click()
Set db = DBEngine.Workspaces(0).OpenDatabase("c:\plus\kk.mdb")
Set td = db.CreateTableDef("temp")
td.Connect = "Text;HDR=No;Database=c:\plus"
td.SourceTableName = "score2"
db.TableDefs.Append td (此时之temp资料表无法修改)
db.execute "select * into 皮皮 from temp"
db.execute "drop table temp"
如此你即可在kk.mdb中看到"皮皮"之资料表(可进行修改)
db.close
set db=nothing
end sub

Follow Ups: