Einzelnen Beitrag anzeigen

daredd

Registriert seit: 2. Apr 2006
433 Beiträge
 
#1

ADOQuery SQL Parameter keine Übergabe

  Alt 7. Mär 2011, 11:21
Datenbank: ACCESS • Version: 2003 • Zugriff über: ADO
Hallo Peopz,

kann mir einer weiterhelfen. Ich versuche mit einer ADOQuery eine Tabelle zu füllen:
Delphi-Quellcode:
procedure TForm2.New_Warenbestand(table1, table2: TADOTable); //Neuer Artikel in Warenbestand (KOMSA)
var
i :Integer;
begin
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('INSERT INTO Warenbestand(products_id, external_id, permission_id, products_owner, products_ean, products_quantity, products_average_quantity,'
+'products_shippingtime, products_model, products_master_model, products_master_flag, products_option_template, products_option_list_template,'
+'products_sort, products_image, products_price, date_added, last_modified, date_available, products_weight, products_status, products_tax_class_id,'
+'product_template, product_list_template, manufacturers_id, products_ordered, products_transactions, products_fsk18, products_vpe, products_vpe_status,'
+'products_vpe_value, products_startpage, products_startpage_sort, products_average_rating, products_rating_count, products_digital,'
+'products_serials, categories, products_description_de, products_name_de, products_short_description_de, url_text_de, meta_title_de, meta_keywords_de,'
+'meta_description_de, products_description_en, products_name_en, products_short_description_en, url_text_en, meta_title_en, meta_keywords_en, meta_description_en)');
ADOQuery1.SQL.Add('VALUES(:products_id, :external_id, :permission_id, :products_owner, :products_ean, :products_quantity, :products_average_quantity,'
+':products_shippingtime, :products_model, :products_master_model, :products_master_flag, :products_option_template, :products_option_list_template,'
+':products_sort, :products_image, :products_price, :date_added, :last_modified, :date_available, :products_weight, :products_status, :products_tax_class_id,'
+':product_template, :product_list_template, :manufacturers_id, :products_ordered, :products_transactions, :products_fsk18, :products_vpe, :products_vpe_status,'
+':products_vpe_value, :products_startpage, :products_startpage_sort, :products_average_rating, :products_rating_count, :products_digital,'
+':products_serials, :categories, :products_description_de, :products_name_de, :products_short_description_de, :url_text_de, :meta_title_de, :meta_keywords_de,'
+':meta_description_de, :products_description_en, :products_name_en, :products_short_description_en, :url_text_en, :meta_title_en, :meta_keywords_en, :meta_description_en)');
i := TableStepBack(table2);
ADOQuery1.Parameters.ParamByName('products_id').Value := i; //hier übergebe ich einen Wert, aber der Debugger mekkat!
ADOQuery1.Parameters.ParamByName('external_id').Value := table1.FieldByName('ARTIKELNUMMER').AsString;
ADOQuery1.Parameters.ParamByName('permission_id').Value := '0';
ADOQuery1.Parameters.ParamByName('products_owner').Value := '1';
.
.
.
ADOQuery1.ExecSQL;
ADOQuery1.Active := true;
end;
Und bei ADOQuery1.Active sagt mir der Debugger:
---------------------------
Benachrichtigung über Debugger-Exception
---------------------------
Im Projekt DatenZugriff.exe ist eine Exception der Klasse EOleException mit der Meldung 'Sie müssen einen Wert in das Feld 'Warenbestand.products_id' eingeben' aufgetreten.
---------------------------
Anhalten Fortsetzen Hilfe
---------------------------

Obwohl ich einen Wert an 'products_id' übergeben, nämlich i. Was ist hier faul?
---------------------------------------------------------------------------
Mein Vista-Kind bringt frischen Wind

Gruß DaRedd aka The Red Dragon
  Mit Zitat antworten Zitat