我在A窗体放了一个adoconnection1和ADOQuery1,代码如下
procedure Tmainform.FormCreate(Sender: TObject);
var
  str:string;
begin
ADOConnection1.ConnectionString :='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\mymessage\message\yhb.mdb;Persist Security Info=False';
try
    adoconnection1.LoginPrompt:=False;
    ADOConnection1.Connected := True;
except
    Application.MessageBox('连接失败,请检查服务器配置是否正确!','提示',MB_OK+MB_ICONINFORMATION);
    Application.Terminate;
end;            
     ADOQuery1.close;
     ADOQuery1.sql.Clear;
     str:='select * from message';
     ADOQuery1.sql.add(str);
     ADOQuery1.Open;
end;
当窗体创建的时候,能连接数据库并打开表,但是我在DataModule1里放上adoconnection1和ADOQuery1
我把代码改成,如下
procedure Tmainform.FormCreate(Sender: TObject);
var
  str:string;
begin
DataModule1.ADOConnection1.ConnectionString :='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\mymessage\message\yhb.mdb;Persist Security Info=False';
try
    DataModule1.adoconnection1.LoginPrompt:=False;
    DataModule1.ADOConnection1.Connected := True;
except
    Application.MessageBox('连接失败,请检查服务器配置是否正确!','提示',MB_OK+MB_ICONINFORMATION);
    Application.Terminate;
end;            
     DataModule1.ADOQuery1.close;
     DataModule1.ADOQuery1.sql.Clear;
     str:='select * from message';
     DataModule1.ADOQuery1.sql.add(str);
     DataModule1.ADOQuery1.Open;
end;
当该窗体创建的时候就出错了
错误提示:"Access violation at address 00483905 in module 'mymessage.exe'.read of address 00000058",请问这是什么原因造成的,请告诉我