Помогите пожалуйста с запросом. Что то не то...
Программа должна добавлять информацию в базу access.
В приведенном куске программы - ошибка... Подскажите...
Код:
procedure TForm1.BAddClick(Sender: TObject);
begin
j:=0;
for i:= 0 to lbTable.Items.Count - 1 do
begin
temp:= 'INSERT INTO' + PC2.Pages[i].Caption +
'VALUES(';
if (TypeFields[j] = 'String') or (TypeFields[j] = 'WideString') then
temp:=temp + '''' + NameEdit[j].Text + ''''
else
temp:= temp + NameEdit[j].Text;
ShowMessage(IntToStr(j));
for j:= j+1 to j + CountFields[i] - 1 do
begin
if (TypeFields[j] = 'String') or (TypeFields[j] = 'WideString') or
(TypeFields[j] = 'DateTime') then
temp:= temp + ', ''' + NameEdit [j].Text + ''''
else
temp:= temp + ', ' + NameEdit[j].Text;
ShowMessage(temp);
end;
temp:= temp + ' ) ';
DBq(temp, false);
end;
end;