我知道你的意思,是直接在程序中创建Access数据库.MDB文件吧,不是表 可用--- DBDrive:= 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+DBPath; if DBDrive<>'' then begin if not fileexists(DBPath) then begin CreateDB := CreateOleObject('ADOX.Catalog'); CreateDB.Create(DBDrive); end; 如果再有问题,我的QQ:57035006
2.adoquery.connection=adoconnection;
adoquery.close;
adoquery.clear;
adoquery.sql.add('select * from tablename');
adoquery.open;
可用---
DBDrive:= 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+DBPath;
if DBDrive<>'' then
begin
if not fileexists(DBPath) then
begin
CreateDB := CreateOleObject('ADOX.Catalog');
CreateDB.Create(DBDrive);
end;
如果再有问题,我的QQ:57035006
ADOQuery.SQL.Text:='Create Table TableName (FieldName Char(?) Not Null,...,constraint TableKey primary key (FieldName))';
ADOQuery.ExecSQL
至于:把表的内容写入数据库,我想上面有人已经作答了
我的QQ:57035006