G
ganzqgy
Unregistered / Unconfirmed
GUEST, unregistred user!
uses
dao2000,dao97,comobj
var
EngineBEngine;
TestDBatabase;
TestTD:TableDef;
TestField:Field;
TestPropertyroperty_;
i:integer;
s,name:String;
begin
name:='c:/db4.mdb';//是access2000数据库
Engine:=CreateComObject(dao2000.CLASS_DBEngine) as _DBEngine;
TestDB:=engine.OpenDatabase(name,dbDriverPrompt,false,'');
TestTD:=TestDB.TableDefs.Item['MarriageRegister'];//MarriageRegister'];
for i:=0 to TestTD.Fields.Count -1 do begin
TestField:=TestTD.Fields.Item;
s:=s+' '+TestField.Properties.Item['caption'].value;
showmessage(s);
end;
可以实现取到access2000中的标题,但只能独占使用,并且必须加dao97才行,不然 TestDB:=engine.OpenDatabase(name,dbDriverPrompt,false,'');通不过,有谁知道dao2000中该语句怎样写。
dao2000,dao97,comobj
var
EngineBEngine;
TestDBatabase;
TestTD:TableDef;
TestField:Field;
TestPropertyroperty_;
i:integer;
s,name:String;
begin
name:='c:/db4.mdb';//是access2000数据库
Engine:=CreateComObject(dao2000.CLASS_DBEngine) as _DBEngine;
TestDB:=engine.OpenDatabase(name,dbDriverPrompt,false,'');
TestTD:=TestDB.TableDefs.Item['MarriageRegister'];//MarriageRegister'];
for i:=0 to TestTD.Fields.Count -1 do begin
TestField:=TestTD.Fields.Item;
s:=s+' '+TestField.Properties.Item['caption'].value;
showmessage(s);
end;
可以实现取到access2000中的标题,但只能独占使用,并且必须加dao97才行,不然 TestDB:=engine.OpenDatabase(name,dbDriverPrompt,false,'');通不过,有谁知道dao2000中该语句怎样写。