春
春意
Unregistered / Unconfirmed
GUEST, unregistred user!
我用ODBC成功连接上MySql数据库后,进行如下的操作修改数据:procedure TForm1.Button5Click(Sender: TObject);var sSql, sMemo: String;begin sSql := 'select * from WorkData where sex = 1'; with ADoquery2 do begin Close; SQL.Clear; SQL.Add(sSql); Open; if RecordCount = 0 then raise Exception.Create('没有数据修改'); ProgressBar1.Max := RecordCount; ProgressBar1.Position := 0; First; while not Eof do begin Edit; sMemo := FieldByName('name').AsString; sMemo := StringReplace(sMemo, Trim(Edt1.Text), Trim(Edt2.Text), [rfReplaceAll]); FieldByName('name').AsString := sMemo; Post;//出错 ProgressBar1.Position := ProgressBar1.Position + 1; Application.ProcessMessages; Next; end; Close; end;end;上面的代码如果操作Sql Server,可以修改,但操作MySql,却不能!希望名位帮助,如何实现上面的功能!