源码如下:
procedure tesg;
var
tempado : TAdoconnection;
sl : tstrings;
begin
tempado := TAdoconnection.Create(self);
tempado.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/Data.mdb'+';Persist Security Info=False';
tempado.LoginPrompt := false;
tempado.Connected := true;
tempado.KeepConnection := true; //create tempado;
tempado.GetTableNames(sl,false);//运行在这儿出错!!!
if sl.count = 0 then
showmessage('nil')
//Project Report.exe raised exception class EAccessViolation with message 'Access violation at address 0041EAD7 in module
//'test.exe'. Read of address 00000008'. Process stopped. Use Step or Run to continue.
end;