-
Content Count
3323 -
Joined
-
Last visited
-
Days Won
110
Everything posted by Lars Fosdal
-
Ole DB (Ado) for MSSQL un-deprecated by Microsoft
Lars Fosdal replied to A.M. Hoornweg's topic in Databases
EMBT placed the above constants in the implementation section of the FireDAC.Phys.MSSQL, which I guess is good for hiding implementation details, but not so good for doing overrides... hello, new literal. Initial benchmarks indicate that C_2016_ODBC = 'ODBC DRIVER 13 FOR SQL SERVER' is about the same speed as SQLNCLI 11, which is good news. class function TPSDFireDatabasePoolMSSQL.FindBestDriver(const Link: TFDPhysMSSQLDriverLink): String; const // Constants copied from implementation section of FireDAC.Phys.MSSQL C_2017_ODBC = 'ODBC DRIVER 17 FOR SQL SERVER'; C_2016_ODBC = 'ODBC DRIVER 13 FOR SQL SERVER'; C_2012_ODBC = 'ODBC DRIVER 11 FOR SQL SERVER'; {$IFDEF POSIX} C_FreeTDS = 'FreeTDS'; {$ENDIF} {$IFDEF MSWINDOWS} C_2012_NC = 'SQL SERVER NATIVE CLIENT 11.0'; {$ENDIF} var DriverList TStringList; WantedList : TArray<String>; begin Result := ''; WantedList := {$IFDEF MSWINDOWS} [C_2017_ODBC, C_2016_ODBC, C_2012_NC, C_2012_ODBC] {$ENDIF} {$IFDEF POSIX} [C_2017_ODBC, C_2016_ODBC, C_2012_ODBC, C_FreeTDS] {$ENDIF}; DriverList := TStringList.Create; try Link.GetDrivers(DriverList); for var Wanted in WantedList do for var Driver in DriverList do if CompareText(Wanted , Driver) = 0 then Exit(Wanted); finally DriverList.Free; end; end; class function TPSDFireDatabasePoolMSSQL.CreateDriverLink(const aOwner: TComponent): TFDPhysDriverLink; var Res: TFDPhysMSSQLDriverLink; begin Res := TFDPhysMSSQLDriverLink.Create(aOwner); Res.ODBCDriver := FindBestDriver(Res); Result := Res; end; -
Ole DB (Ado) for MSSQL un-deprecated by Microsoft
Lars Fosdal replied to A.M. Hoornweg's topic in Databases
Oddly enough, FireDAC seems to prefer SQLNCLI over everything else, and I can't find a way to override that priority, apart from explicitly setting the ODBCDriver on Create, which makes it harder to handle it not being installed procedure TFDPhysMSSQLDriver.InternalLoad; begin inherited InternalLoad; if ODBCDriver = '' then ODBCDriver := FindBestDriver( {$IFDEF MSWINDOWS} [C_2012_NC, C_2016_ODBC, C_2012_ODBC, C_2017_ODBC, C_2008, C_2005, C_2000] {$ENDIF} {$IFDEF POSIX} [C_2016_ODBC, C_2012_ODBC, C_2017_ODBC, C_FreeTDS], C_FreeTDSLib {$ENDIF} ); end; -
Unreliable connection to remote MS SQL Server database
Lars Fosdal replied to Martyn Spencer's topic in Databases
Somewhat related: SQLNCLI is deprecated. MSOLEDBSQL is the new best practice. As for unreliable connections - some servers disconnects pretty quick, so we have a wrapper that handles this and reconnects as required. -
Cross platform version of Windows.WinAPI.IsDebuggerPresent ?
Lars Fosdal posted a topic in Cross-platform
Is there a cross-platform version of IsDebuggerPresent? I want to disable some of my automatic maintenance threads when the app is running under a debugger, now also for a FireMonkey app. -
TIdSSLIOHandlerSocketOpenSSL and TLS 1.3 ?
Lars Fosdal replied to Lars Fosdal's topic in Network, Cloud and Web
https://stackoverflow.com/questions/50481630/upgrade-indy-library-to-use-latest-openssl-library The answer is still "no". -
Hands-On Design Patterns with Delphi
Lars Fosdal replied to Primož Gabrijelčič's topic in Tips / Blogs / Tutorials / Videos
Ordered print + epub version. -
Trying to track down an Access Violation in "Vcl.Imaging.pngimage" method "TChunkIHDR.PrepareImageData", calling "fillchar"
Lars Fosdal replied to jeroenp's topic in VCL
My guess: The SetPosition / Seek ends up with an out of bounds address? -
Delphi pitfalls: Enumerated types and for loops
Lars Fosdal replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
I still prefer using regular constants for bit-fiddling.- 39 replies
-
- pitfall
- enumerated type
-
(and 1 more)
Tagged with:
-
Ole DB (Ado) for MSSQL un-deprecated by Microsoft
Lars Fosdal replied to A.M. Hoornweg's topic in Databases
Interesting. Has anyone done any benchmarking of the MSOLEDBSQL driver vs the SQLNCLI driver? -
Interesting. Does Rapid function properly with RTTI as well?
-
Delphi pitfalls: Enumerated types and for loops
Lars Fosdal replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
Just curious: Has anyone seen a valid use case for defined ordinal values in enumerations?- 39 replies
-
- pitfall
- enumerated type
-
(and 1 more)
Tagged with:
-
Delphi pitfalls: Enumerated types and for loops
Lars Fosdal replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
That is the "weird" right there. Definitively a good reason to avoid defined ordinal values in enumerations.- 39 replies
-
- pitfall
- enumerated type
-
(and 1 more)
Tagged with:
-
Delphi pitfalls: Enumerated types and for loops
Lars Fosdal replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
Isn't there something weird about RTTI for enums that have manually set ordinal values as well?- 39 replies
-
- pitfall
- enumerated type
-
(and 1 more)
Tagged with:
-
Delphi pitfalls: Enumerated types and for loops
Lars Fosdal replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
I did mean dynamic arrays. My bad.- 39 replies
-
- pitfall
- enumerated type
-
(and 1 more)
Tagged with:
-
Delphi pitfalls: Enumerated types and for loops
Lars Fosdal replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
Off-topic: There is another oddity with enumerations with explicit ordinal values. TEnum = (plough = 5, foo = 9, bar = 14, wtf = 1000); The above is valid, but wtf can't be used in a set. Makes me wonder if it would be better to generally do sets as dynamic arrays, instead of today's implementation of sets. I guess it would be more expensive.- 39 replies
-
- pitfall
- enumerated type
-
(and 1 more)
Tagged with:
-
Right you are, @dummzeuch : Problem solved.
-
To where are you trying to save the file?
-
Now I am suddenly not so happy about the Parnassus integration in 10.3. It murdered my 10.2 Parnassus plugins.
-
I think it could be fantastic if it was possible to design custom property lists per class. The first time a class is seen, it could be added to a list of class property configs, with all the props present. In a config dialog somewhere, it could be possible to enable/disable each prop. The filter could even use digits 0..9 to select one of multiple configurations per class. Naturally, if it could be installed with default filters for many of the standard components, that would be nice. I really like the idea - more than I like quick edit. Nice work!
-
Very odd. I did have 10.3 from November installed and did a reinstall and the uninstall hung at the end. Perhaps I need to redo it 😕 - or wait until the new laptop arrives. I do love that Parnassus Bookmarks and Navigator is included, though!
-
Installed 10.3.1 using the web installer. Something looks strange. No 10.3.1 mention. Installed update is 10.2 update 2?
-
version control system Version Control System
Lars Fosdal replied to Soji's topic in Delphi IDE and APIs
He lives at https://twitter.com/uscle?lang=en- 49 replies
-
- git
- subversion
-
(and 1 more)
Tagged with:
-
version control system Version Control System
Lars Fosdal replied to Soji's topic in Delphi IDE and APIs
How does SourceTree and Github Desktop compare?- 49 replies
-
- git
- subversion
-
(and 1 more)
Tagged with:
-
Delphi pitfalls: Enumerated types and for loops
Lars Fosdal replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
Declared: TEnum = (plough, foo, bar, wtf) Test order: [wtf, plough, bar, foo] Looping an Enum Set 1 wtf 5 plough 9 foo 14 bar Looping an Enum Array 1 wtf 5 plough 14 bar 9 foo Press Enter: You are right, @Stefan Glienke -I am so logging off now 😄- 39 replies
-
- pitfall
- enumerated type
-
(and 1 more)
Tagged with:
-
Delphi pitfalls: Enumerated types and for loops
Lars Fosdal replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
Wow, I didn't notice that! And it is not related to declaration order, nor ordinal value. That is a bit disturbing.- 39 replies
-
- pitfall
- enumerated type
-
(and 1 more)
Tagged with: