procedure TForm1.Button1Click(Sender: TObject);
var
aconnect : variant;
ConnectionString : string;
ARecordSet : _Recordset;
ds:TDataSet;
begin
aconnect := createoleobject('adodb.connection');
connectionstring := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:/Javascript/News.MDB;Persist Security Info=False';
AConnect.Open( ConnectionString );
showmessage('连接成功');
ARecordSet:=CreateOleObject('ADODB.RecordSet') as _Recordset;//直接通过指针
ARecordSet.Open('Select * from type',aconnect,3,3,1);
ds:=TADODataSet.Create(self);
TCustomADODataSet(ds).Recordset:=ARecordSet;
DataSource1.DataSet:=ds;///recodeset传给grid
end;
其他的就自己看吧
个人建议用query较为简单
楼主是vb转过来的吧