来源:www.cncfan.com | 2006-1-13 | (有4094人读过)
var filename: String;
filename := ExtractFilePath(Application.ExeName ); ADOConnection1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + filename + '数据库名.mdb;Persist Security Info=False'; ADOConnection1.LoginPrompt := false; ADOConnection1.Connected := true; ADOQuery1.Connection := ADOConnection1; with ADOQuery1 do begin Close SQL.clear; SQL.Add('select * from 数据表'); Open; ShowMessage(Fields[1].Value); end; //最后把它们关闭 ADOConnection1.Close; ADOQuery1.Close;
|