{"id":8687,"date":"2022-09-15T00:20:20","date_gmt":"2022-09-14T18:50:20","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/"},"modified":"2022-09-15T00:20:20","modified_gmt":"2022-09-14T18:50:20","slug":"solved-syntax-error-in-query-expression-delphi","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/","title":{"rendered":"[Solved] Syntax error. in query expression -Delphi"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-45550865\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"45550865\" data-parentid=\"45542964\" data-score=\"0\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>Give a try;<\/p>\n<pre><code>Procedure TFNewCarAct.BtnSaveClick(Sender: TObject);\nbegin\nadoQueryCCA.Close();\nadoQueryCCA.SQL.Clear;\nadoQueryCCA.SQL.Add('INSERT INTO tblcaractivity ([CCarID],[Date],[Millage],[SerRcd],[EOType],[EOQunt],[AirFil],[GOil])');\nadoQueryCCA.SQL.Add('VALUES(:CCarID,:Date,:Millage,:SerRcd,:EOType,:EOQunt,:AirFil,:GOil)');\nadoQueryCCA.Parameters.ParamByName('CCarID').Value:= Integer(ComboBox2.Items.Objects[ComboBox2.ItemIndex]);\nadoQueryCCA.Parameters.ParamByName('Date').Value:= Edit6.Text;\nadoQueryCCA.Parameters.ParamByName('Millage').Value:= Edit1.Text;\nadoQueryCCA.Parameters.ParamByName('SerRcd').Value:= memo1.Text;\nadoQueryCCA.Parameters.ParamByName('EOType').Value:= Edit2.Text;\nadoQueryCCA.Parameters.ParamByName('EOQunt').Value:= Edit3.Text;\nadoQueryCCA.Parameters.ParamByName('AirFil').Value:= Edit4.Text;\nadoQueryCCA.Parameters.ParamByName('GOil').Value:= Edit5.Text;\nadoQueryCCA.ExecSQL;\nShowMessage('Done');\nend;\n\nprocedure TFNewCarAct.FromShow(Sender: TObject);\nbegin\n   ADOQueryCT.Open;\n   while Not ADOQueryCT.Eof do\n   begin\n      ComboBox1.Items.Add(ADOQueryCT.FieldByName('Name').AsString);\n      ADOQueryCT.Next;\n   end;\n   ADOQueryCT.Close;\n   if ComboBox1.Items.Count &gt; 0 then ComboBox1.ItemIndex := 0;\n   end;\n\nprocedure TFNewCarAct.OnComboBox1Change(Sender: TObject);\nbegin\n ComboBox2.Items.BeginUpdate;\n   try\n      ComboBox2.Clear;\n      ADOQueryCC.Parameters.ParamByName('Name').Value := ComboBox1.Text;\n      ADOQueryCC.Open;\n      while Not ADOQueryCC.Eof do\n      begin\n         ComboBox2.Items.AddObject(ADOQueryCC.FieldByName('Car').AsString, TObject(ADOQueryCC.FieldByName('CCarID').AsInteger));\n         ADOQueryCC.Next;\n      end;\n      ADOQueryCC.Close;\n      if ComboBox2.Items.Count &gt; 0 then ComboBox2.ItemIndex := 0;\n   finally\n      ComboBox2.Items.EndUpdate;\n   end;\nend;\n<\/code><\/pre>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">0<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Syntax error. in query expression -Delphi <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] Give a try; Procedure TFNewCarAct.BtnSaveClick(Sender: TObject); begin adoQueryCCA.Close(); adoQueryCCA.SQL.Clear; adoQueryCCA.SQL.Add(&#8216;INSERT INTO tblcaractivity ([CCarID],[Date],[Millage],[SerRcd],[EOType],[EOQunt],[AirFil],[GOil])&#8217;); adoQueryCCA.SQL.Add(&#8216;VALUES(:CCarID,:Date,:Millage,:SerRcd,:EOType,:EOQunt,:AirFil,:GOil)&#8217;); adoQueryCCA.Parameters.ParamByName(&#8216;CCarID&#8217;).Value:= Integer(ComboBox2.Items.Objects[ComboBox2.ItemIndex]); adoQueryCCA.Parameters.ParamByName(&#8216;Date&#8217;).Value:= Edit6.Text; adoQueryCCA.Parameters.ParamByName(&#8216;Millage&#8217;).Value:= Edit1.Text; adoQueryCCA.Parameters.ParamByName(&#8216;SerRcd&#8217;).Value:= memo1.Text; adoQueryCCA.Parameters.ParamByName(&#8216;EOType&#8217;).Value:= Edit2.Text; adoQueryCCA.Parameters.ParamByName(&#8216;EOQunt&#8217;).Value:= Edit3.Text; adoQueryCCA.Parameters.ParamByName(&#8216;AirFil&#8217;).Value:= Edit4.Text; adoQueryCCA.Parameters.ParamByName(&#8216;GOil&#8217;).Value:= Edit5.Text; adoQueryCCA.ExecSQL; ShowMessage(&#8216;Done&#8217;); end; procedure TFNewCarAct.FromShow(Sender: TObject); begin ADOQueryCT.Open; while Not ADOQueryCT.Eof do begin ComboBox1.Items.Add(ADOQueryCT.FieldByName(&#8216;Name&#8217;).AsString); ADOQueryCT.Next; end; ADOQueryCT.Close; if ComboBox1.Items.Count &gt; 0 then ComboBox1.ItemIndex := &#8230; <a title=\"[Solved] Syntax error. in query expression -Delphi\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/\" aria-label=\"More on [Solved] Syntax error. in query expression -Delphi\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[740,2459,473,341,2460],"class_list":["post-8687","post","type-post","status-publish","format-standard","hentry","category-solved","tag-delphi","tag-delphi-xe8","tag-ms-access","tag-sql","tag-tadoquery"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] Syntax error. in query expression -Delphi - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Syntax error. in query expression -Delphi - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] Give a try; Procedure TFNewCarAct.BtnSaveClick(Sender: TObject); begin adoQueryCCA.Close(); adoQueryCCA.SQL.Clear; adoQueryCCA.SQL.Add(&#039;INSERT INTO tblcaractivity ([CCarID],[Date],[Millage],[SerRcd],[EOType],[EOQunt],[AirFil],[GOil])&#039;); adoQueryCCA.SQL.Add(&#039;VALUES(:CCarID,:Date,:Millage,:SerRcd,:EOType,:EOQunt,:AirFil,:GOil)&#039;); adoQueryCCA.Parameters.ParamByName(&#039;CCarID&#039;).Value:= Integer(ComboBox2.Items.Objects[ComboBox2.ItemIndex]); adoQueryCCA.Parameters.ParamByName(&#039;Date&#039;).Value:= Edit6.Text; adoQueryCCA.Parameters.ParamByName(&#039;Millage&#039;).Value:= Edit1.Text; adoQueryCCA.Parameters.ParamByName(&#039;SerRcd&#039;).Value:= memo1.Text; adoQueryCCA.Parameters.ParamByName(&#039;EOType&#039;).Value:= Edit2.Text; adoQueryCCA.Parameters.ParamByName(&#039;EOQunt&#039;).Value:= Edit3.Text; adoQueryCCA.Parameters.ParamByName(&#039;AirFil&#039;).Value:= Edit4.Text; adoQueryCCA.Parameters.ParamByName(&#039;GOil&#039;).Value:= Edit5.Text; adoQueryCCA.ExecSQL; ShowMessage(&#039;Done&#039;); end; procedure TFNewCarAct.FromShow(Sender: TObject); begin ADOQueryCT.Open; while Not ADOQueryCT.Eof do begin ComboBox1.Items.Add(ADOQueryCT.FieldByName(&#039;Name&#039;).AsString); ADOQueryCT.Next; end; ADOQueryCT.Close; if ComboBox1.Items.Count &gt; 0 then ComboBox1.ItemIndex := ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-14T18:50:20+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Syntax error. in query expression -Delphi\",\"datePublished\":\"2022-09-14T18:50:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/\"},\"wordCount\":19,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"delphi\",\"delphi-xe8\",\"ms-access\",\"sql\",\"tadoquery\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/\",\"name\":\"[Solved] Syntax error. in query expression -Delphi - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-09-14T18:50:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Syntax error. in query expression -Delphi\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1776403586\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1776403586\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Syntax error. in query expression -Delphi - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Syntax error. in query expression -Delphi - JassWeb","og_description":"[ad_1] Give a try; Procedure TFNewCarAct.BtnSaveClick(Sender: TObject); begin adoQueryCCA.Close(); adoQueryCCA.SQL.Clear; adoQueryCCA.SQL.Add('INSERT INTO tblcaractivity ([CCarID],[Date],[Millage],[SerRcd],[EOType],[EOQunt],[AirFil],[GOil])'); adoQueryCCA.SQL.Add('VALUES(:CCarID,:Date,:Millage,:SerRcd,:EOType,:EOQunt,:AirFil,:GOil)'); adoQueryCCA.Parameters.ParamByName('CCarID').Value:= Integer(ComboBox2.Items.Objects[ComboBox2.ItemIndex]); adoQueryCCA.Parameters.ParamByName('Date').Value:= Edit6.Text; adoQueryCCA.Parameters.ParamByName('Millage').Value:= Edit1.Text; adoQueryCCA.Parameters.ParamByName('SerRcd').Value:= memo1.Text; adoQueryCCA.Parameters.ParamByName('EOType').Value:= Edit2.Text; adoQueryCCA.Parameters.ParamByName('EOQunt').Value:= Edit3.Text; adoQueryCCA.Parameters.ParamByName('AirFil').Value:= Edit4.Text; adoQueryCCA.Parameters.ParamByName('GOil').Value:= Edit5.Text; adoQueryCCA.ExecSQL; ShowMessage('Done'); end; procedure TFNewCarAct.FromShow(Sender: TObject); begin ADOQueryCT.Open; while Not ADOQueryCT.Eof do begin ComboBox1.Items.Add(ADOQueryCT.FieldByName('Name').AsString); ADOQueryCT.Next; end; ADOQueryCT.Close; if ComboBox1.Items.Count &gt; 0 then ComboBox1.ItemIndex := ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/","og_site_name":"JassWeb","article_published_time":"2022-09-14T18:50:20+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Syntax error. in query expression -Delphi","datePublished":"2022-09-14T18:50:20+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/"},"wordCount":19,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["delphi","delphi-xe8","ms-access","sql","tadoquery"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/","url":"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/","name":"[Solved] Syntax error. in query expression -Delphi - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-09-14T18:50:20+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-syntax-error-in-query-expression-delphi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Syntax error. in query expression -Delphi"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1776403586","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1776403586","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/8687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=8687"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/8687\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=8687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=8687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=8687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}