procedure TForm1.SpeedButton1Click(Sender: TObject);<br>var<br> sFileName, sXMID, sWHRID: string;<br> XLSApp: Variant;<br> i, iRow, RowCount: Integer;<br>begin<br> if not OpenDialog1.Execute then Exit;<br> sFileName := OpenDialog1.FileName;<br><br> XLSApp := CreateOleObject('EXCEL.APPLICATION');<br> XLSApp.Application.Workbooks.Open(sFileName);<br><br> RowCount := XLSApp.Application.WorkBooks[1].ActiveSheet.UsedRange.Rows.Count;<br> i := 1;<br> for iRow := 1 to RowCount do<br> begin<br> with qry do<br> begin<br> Close;<br> SQL.Clear;<br> SQL.Add('insert into ');<br><br> SQL.Add(')');<br> SQL.Add('values');<br> SQL.Add(' ');<br> ParamByName(ZBZ').AsString := XLSApp.Application.Workbooks.ActiveSheet.Cells[iRow, 10];<br> ExecSQL;<br> end<br><br> end;<br>end;