

JonRobertson
Members-
Content Count
289 -
Joined
-
Last visited
-
Days Won
7
Everything posted by JonRobertson
-
Sure, because that is the path that you hardcoded to FDConnection1.Params.Database: Try this instead: FDConnection1.Params.Database := ExtractFilePath(Application.ExeName) + 'dat2.sqlite'; If ExtractFilePath is an undefined identifier, add SysUtils to the uses statement below the implementation keyword.
-
The easy way to test anything in programming is to intentionally break code. For example, in your SQLite project, change Database= to a file that you know does not exist. When I did that, I got a dialog saying "unable to open database file." Using the link you provided, I did that tutorial with the Employee.s3db database in Embarcadero's samples folder, and it worked as expected. And if I change the query to SELECT * from dat2, I get the same error you are (as I would expect with this database). Attached is my version of the tutorial project. Object names don't match the tutorial and I added output when no rows are returned. It attaches to a database named dat2.db in the same folder as the project. The screenshot you posted of the database & table did not have "data type" for each column. Are you sure you have completely created *and* saved the database? I used DB Browser for SQLite and there is a button to "Write Changes". My best guess is the database file that your Delphi project is opening does not have a table named dat2. Tutorial.zip
-
Good delphi learning sites for new team member
JonRobertson replied to mvanrijnen's topic in Tips / Blogs / Tutorials / Videos
I would not suggest jumping into the source of an IDE Expert. There are many open source repos that could be beneficial. Here are a few, and these are just github. Embarcadero GitHub - Project samples included with the past several versions of Delphi and some other interesting repos. Delphi topic on GitHub - Over 2,200 open source projects Edit: This may be useful: Coding Boot Camp 2022 -
Good delphi learning sites for new team member
JonRobertson replied to mvanrijnen's topic in Tips / Blogs / Tutorials / Videos
Search engines are your friend. Here is a small list. None of these offer structure like a training course or a classroom curriculum. But there are some worthwhile articles and videos. https://delphi.fandom.com/wiki/Delphi_Wiki https://www.delphibasics.co.uk/ Embarcadero YouTube LearnDelphi.tv Delphi Programming Tutorials Not free: Embarcadero Academy I personally prefer books. Shortly after I started using Delphi, my go to Delphi bibles were Mastering Delphi 2 and Delphi Developer's Handbook, both by Marco Cantu. Most everything in those books still apply, although they were written nearly 30 years ago. There are several good "current" Delphi books that would cover more recent language additions but may assume the reader already knows the basics. Coding in Delphi and More Coding in Delphi by Nick Hodges are good for the Delphi language itself. But check out other authors as well. There are a number of excellent books on Delphi by some great authors. -
Is that tutorial online? If so, please post a link.
-
That isn't the ConnectDB_u.dfm for the ConnectDB_u.pas that you posted above. The name of the form in that DFM is TForm1 and none of the components on your TfrmConnectDB form are in the DFM code you posted. It should look more like this: object frmConnectDB: TfrmConnectDB Left = 0 Top = 0 Caption = 'frmConnectDB' ClientHeight = 442 ClientWidth = 628 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -12 Font.Name = 'Segoe UI' Font.Style = [] TextHeight = 15 object btnConnect: TButton Left = 280 Top = 232 Width = 75 Height = 25 Caption = 'btnConnect' TabOrder = 0 OnClick = btnConnectClick end object btnExecute: TButton Left = 280 Top = 312 Width = 75 Height = 25 Caption = 'btnExecute' TabOrder = 1 OnClick = btnExecuteClick end object memOutput: TMemo Left = 320 Top = 56 Width = 185 Height = 89 TabOrder = 2 end object SQLConnection1: TSQLConnection DriverName = 'Sqlite' Params.Strings = ( 'DriverUnit=Data.DbxSqlite' 'DriverPackageLoader=TDBXSqliteDriverLoader,DBXSqliteDriver280.bp' + 'l' 'MetaDataPackageLoader=TDBXSqliteMetaDataCommandFactory,DbxSqlite' + 'Driver280.bpl' 'FailIfMissing=True' 'Database=') Left = 304 Top = 384 end object SQLQuery1: TSQLQuery Params = <> Left = 416 Top = 296 end end
-
Open ConnectDB_u.dfm in Notepad, copy entire contents to the clipboard, and paste that in a reply to this post. I am curious how SQLQuery1 is configured in the form designer. Another approach is to select SQLQuery1 in the form designer, press ctrl-c to copy just that component to the clipboard, and post it. But there could be other helpful details in the entire DFM, such as how SQLConnection1 is configured.
-
Has anyone attempted to add VCL Styles support to TChromeTabs? In my search, I see Jerry Dodge asked the author on StackOverflow back in 2015, who responded he did not use VCL Styles and had no plans on adding the support. I can attempt to do it. I think most of the work would be in TCustomChromeTabs.DrawCanvas. Unfortunately, I have very little experience writing custom drawing/painting code and no experience implementing VCL Styles in a component. Can anyone recommend a book or online resource to get my feet wet?
-
VCL Styles support for TChromeTabs
JonRobertson replied to JonRobertson's topic in Delphi Third-Party
Thank you for the suggestion. I have looked at code by Ray, Chris Rolliston, and Rodrigo Ruz. My first attempt was a good learning experience. Now I need to start over and do it piece by piece. -
Favorite feature(s) of other editors that Delphi does not offer
JonRobertson replied to dummzeuch's topic in Delphi IDE and APIs
Except you don't run the Delphi IDE on any system. An IDE that is not cross-platform will have limited cross-platform capabilities. Going down that discussion is going off-topic, imo. That said, I agree that an editor having "front-end" capabilities is a good thing. And some of those may depend on integrating with backend services, such as a LSP server, which may or may not be on the local machine. -
Favorite feature(s) of other editors that Delphi does not offer
JonRobertson replied to dummzeuch's topic in Delphi IDE and APIs
Yes. I have a license for Pro Edition. I have been a user and fan of BC since version 1. But I do not care for the Delphi IDE integration. I use the Explorer integration and have TortoiseGit configured to use BC. -
Favorite feature(s) of other editors that Delphi does not offer
JonRobertson replied to dummzeuch's topic in Delphi IDE and APIs
I agree that Undo would be beneficial in the form designer. Saying that, "change history" is one of many benefits of good source control, such as git. I use "Git diff with previous version" quite often with both DFM and PAS files. And DPROJ, for that matter. I have Beyond Compare installed with Delphi IDE integration. Unfortunately I am not a fan of BC's Delphi integration. It has bit me more than once. -
I don't understand the question. On my Windows 11 laptop, TOSVersion.ToString returns Windows 11 (Version 22H2, OS Build 22621.2715, 64-bit Edition) You could look at TOSVersion.Create in System.SysUtils.pas. TOSVersion.Name should also return "Windows 11"
-
What is the benefit of sorting the Uses clause?
JonRobertson replied to RCrandall's topic in MMX Code Explorer
Is it published? I looked on https://blog.dummzeuch.de/ but could not find it there or in GExperts. -
Are wildcards supported in () groups? Is this list valid for MMX? Winapi;System.Win;System;Data;Vcl;(hyie*,ie*,imageen*);pp*;Rz*;ra*;vcl.ww* Ctrl-Alt-U is moving (hyie*,ie*,imageen*) below everything in the list. My expectation is that my () group is invalid and MMX is ignoring it. Before: uses Winapi.Windows, System.Classes, System.Generics.Collections, System.ImageList, System.SysUtils, Data.Win.ADODB, Vcl.ActnPopup, Vcl.BaseImageCollection, Vcl.Buttons, Vcl.Controls, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Forms, Vcl.Graphics, Vcl.ImgList, Vcl.Menus, Vcl.PlatformDefaultStyleActnCtrls, Vcl.StdCtrls, Vcl.OleServer, Vcl.VirtualImageList, hyiedefs, hyieutils, iemio, iemview, ieview, iesettings, iexBitmaps, iexLayers, iexProcEffects, iexRulers, iexToolbars, iexUserInteractions, imageenio, imageenproc, imageenview, RzButton, RzCmboBx, RzLabel, RzPanel, RzSplit, RzShellDialogs, SVGIconImageCollection, SVGIconImageListBase, SVGIconVirtualImageList, OutlookXP, uAisDocument, uUserSettings, udmResources, udmDocResources; After: uses Winapi.Windows, System.Classes, System.Generics.Collections, System.ImageList, System.SysUtils, Data.Win.ADODB, Vcl.ActnPopup, Vcl.BaseImageCollection, Vcl.Buttons, Vcl.Controls, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Forms, Vcl.Graphics, Vcl.ImgList, Vcl.Menus, Vcl.PlatformDefaultStyleActnCtrls, Vcl.StdCtrls, Vcl.OleServer, Vcl.VirtualImageList, RzButton, RzCmboBx, RzLabel, RzPanel, RzSplit, RzShellDialogs, hyiedefs, hyieutils, iemio, iemview, ieview, iesettings, iexBitmaps, iexLayers, iexProcEffects, iexRulers, iexToolbars, iexUserInteractions, imageenio, imageenproc, imageenview, SVGIconImageCollection, SVGIconImageListBase, SVGIconVirtualImageList, OutlookXP, uAisDocument, uUserSettings, udmResources, udmDocResources;
-
Can not install Delphi Community Edition 11.2
JonRobertson replied to Kurt G's topic in General Help
You can give a reaction to a post, such as Thanks. Hover your mouse over the heart icon in the lower right corner of a post to select a reaction. -
What is the benefit of sorting the Uses clause?
JonRobertson replied to RCrandall's topic in MMX Code Explorer
How do you configure groups like (ZipForge)? I could not find that in MMX Properties or MMX Project Options. I would like to do this for ImageEn and maybe others. ImageEn units do not have a consistent prefix suitable for grouping. Thanks! Thanks -
"Auto complete used units" does not recognize units without unit scope.
JonRobertson posted a topic in MMX Code Explorer
I sent an email to support@mmx-delphi.de. I decided to post here in case someone knows a solution aside from turning off "Auto complete used units" under Pascal->Editing. When adding an event, MMX does not recognize when the required unit is already in the uses clause without a unit scope. For example, adding an event for TDataSet.OnNewRecord adds "Data.DB" to the uses clause, even though "DB" is already in the uses clause. [MMX] FormUsers(12): Auto Completed uses clause. Added: Data.DB On compile/build, this results in: [dcc32 Error] E2004 Identifier redeclared: 'Data.DB' This is a legacy project. Adding unit scopes to each unit reference is on the to-do list. I do feel this is a flaw in MMX that could be corrected if MMX can distinguish the unit scope from the unit name. Jon -
"Auto complete used units" does not recognize units without unit scope.
JonRobertson replied to JonRobertson's topic in MMX Code Explorer
I wanted to say that yesterday I took the time to configure MMX to group and sort uses clauses they way I wanted and it is working great. I expect you hear this a lot, but thank you for your help and keeping MMX alive. I did not have the opportunity to use Code Explorer when it was a ModelMaker product. Yesterday I took the time to go through most of the options and will be changing my coding habits to take advantage of more MMX features. -
D11.3, Search, Whole words only - randomly checked
JonRobertson replied to mvanrijnen's topic in Delphi IDE and APIs
For me, it was always "Entire Scope" that would become enabled for some reason. Any idea if that is also fixed in Delphi 12? It has not happened to be so far. But it was always sporadic and I have not spent enough time in Delphi 12 to have an opinion on that issue. -
sk4d.dll Delphi 12 when app becomes 'SKIA' enabled question
JonRobertson replied to rudy999's topic in General Help
I have SVGIconImageList installed and don't see a related sk4d.dll. The only two sk4d dlls on my system are under (Program Files)\Embarcadero\Studio\23.0\ -
"Auto complete used units" does not recognize units without unit scope.
JonRobertson replied to JonRobertson's topic in MMX Code Explorer
The behavior in that project was due to the .DPR not having unit scope names in its uses clause. -
"Auto complete used units" does not recognize units without unit scope.
JonRobertson replied to JonRobertson's topic in MMX Code Explorer
I will attempt to recreate sometime today. Thanks Uwe. -
"Auto complete used units" does not recognize units without unit scope.
JonRobertson replied to JonRobertson's topic in MMX Code Explorer
Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;Data.Win;System.Win I recently started this position and inherited this project. At the time, was partially migrated from Delphi 7 to Delphi 10. I have not modified the Unit Scope Names in the project as I have not needed to. -
"Auto complete used units" does not recognize units without unit scope.
JonRobertson replied to JonRobertson's topic in MMX Code Explorer
I must be doing something wrong. In MMX Properties, Pascal, Sorting, I enabled "Group and sort uses clauses". But Ctrl-Alt-U changes this uses ShlObj, SysUtils, Windows; to this uses Winapi.ShlObj, SysUtils, Windows; and I expected this uses System.SysUtils, Winapi.ShlObj, Winapi.Windows; This is using Delphi 11.3 and MMX 15.1.7 build 2567. Thanks