procedure TForm1.Button1Click(Sender: TObject);
var
cat:OleVariant;
begin
try
begin
if FileExists('d:/'+'my.mdb') then
begin
MessageBox(Application.Handle,PChar('不能删除'+'d:/'+'my.mdb已经存在'),'delete database error!',mb_ok+mb_iconerror);
exit;
end
else
with ADOQuery2 do
begin
cat:=CreateOleObject('adox.catalog');
cat.create('provider=microsoft.jet.oledb.4.0;data source=d:/my.mdb');
end;
end;
finally
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
adoconnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:/my.mdb;Persist Security Info=False';
adoquery2.Close;
adoquery2.SQL.Text:='create table my'+
'('+
'classid int not null,'+
'classtitle char(100) not null,'+
'parentclassid int not null,'+
'classtype tinyint eefault 0'+
')';
adoquery2.ExecSQL;
end;
end.
提示:missing connection or connectionstring
这个问题如何解决啊?