The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

Archive for July 11th, 2018

“The login already has an account under a different user name.” – MSSQL

Posted by jpluimers on 2018/07/11

You get “The login already has an account under a different user name.” when you try to create a user that already exists.

In this case it was a statement somewhere in a database creation script having a statement like this:

exec sp_addlogin N'<<UserName>>', N'<<Password>>', @logonDatabase, @logonLanguage

What happened was that the <<UserName>> in the script already existed and was used to create the new user using sp_addlogin.

I know that this is deprecated, but the search above also shows it happen with other ways of adding users.

It had been a while since doing SQL Server, so this was a good time for me to find back the relation between [WayBack] SQL Server Logins and Users

These queries will help you identify which ones are currently in your database:

use CRM124TestJWP
go

select sl.name as LoginName
     , su.name as UserName
     , sl.dbname as DatabaseName
from sys.sysusers su
join sys.syslogins sl on sl.sid = su.sid

select sp.name as LoginName
     , sp.type_desc as LoginType
     , dp.name as UserName
     , dp.type_desc as UserType
     , sp.default_database_name as DefaultDatabase
     , dp.default_schema_name as DefaultSchema
from sys.server_principals sp
join sys.database_principals dp on dp.sid = sp.sid

Via: [WayBack] sql server – The login already has an account under a different user name – Database Administrators Stack Exchange

Read the rest of this entry »

Posted in Database Development, Development, SQL Server | Leave a Comment »

Delphi – pressing Ctrl-A on a TDBEdit was partially fixed in Delphi 10.2 Tokyo

Posted by jpluimers on 2018/07/11

[WayBack] QualityCentral 110308 – TDBEdit updates wrongly Datalink.Modified when Dataset being in Browse mode and [WayBack] QualityCentral 127300 – Closed Exception When Ctrl+A (select text) on TDBEdit have been partially fixed in Delphi 10.2 Tokyo under [RSP-16288] Bug after selecting all the text by pressing Ctrl+A in TDBEdit and pressing TAB – Embarcadero Technologies.

Since there is only manual syncing from Quality Portal to Quality Central, and only Quality Central is indexed by search engines, the public at large usually finds the Quality Central bugs.

Basically, the affected controls ([WayBack] TDBEdit, [WayBackTDBComboBox, [WayBack] TDBMemo, but not [WayBackTDBRichEdit – probably not needed as I could not reproduce the [WayBack] TClientDataSet based QC127300 attachment in Delphi 10.1 with TDBMemo or TDBRichEdit, though neither selected of these two all text, which 10.2 also fixes).

the .KeyPress methods now check for a Ctrl-A case like this:

    ^A:
      begin
        SelectAll;
        Key := #0;
      end;

and some of the .KeyDown methods have been tuned a little by setting Key := 0 when Edit returns false.

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

“Don’t access VCL from a background thread” – how to demo that?

Posted by jpluimers on 2018/07/11

When accessing the VCL from multiple threads at the same time: adopted from ...\DEMOS\THREADS\THRDDEMO.DPR

When accessing the VCL from multiple threads at the same time: adopted from …\DEMOS\THREADS\THRDDEMO.DPR

Great question a while ago:

[WayBack] “Don’t access VCL from a background thread” – how to demo that? – Primož Gabrijelčič – Google+

For me, the ultimate way why not to access the VCL from a background thread is the precursor of the official threads demo that ships from Delphi 2 to Delphi XE6 in ...DEMOS\THREADS\THRDDEMO.DPR. where you’d think the thread isolation would be in ...DEMOS\THREADS\ThSort.pas but actually is in ...DEMOS\THREADS\SortThds.pas.

The first public showing of that demo did not include main thread protection. It originates from a session at the the 1995 Borland Developers Conference where Ray Konopka showed the below code from Bob Ainsbury.

That session reminded why this joke [WayBack] Via the EKON20 sessions… – Jeroen Wiert Pluimers – Google+ was so funny:  “When Ray Konopka enters the room you have a Raize condition.“.

The question above also made me find back this reference to BorCon95 in San Diego:

Read the rest of this entry »

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 10.2 Tokyo (Godzilla), Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 2 Comments »

Transform Your ESP8266 Board into a USB to Serial Board Easily with Arduino Serial Bypass Sketch

Posted by jpluimers on 2018/07/11

An interesting re-use: [WayBackTransform Your ESP8266 Board into a USB to Serial Board Easily with Arduino Serial Bypass Sketch

Via: [WayBack] If you don’t have a USB to TTL board around, you can use an +ESP8266 board instead (or any other Arduino compatible boards with USB). – Jean-Luc Aufranc – Google+

–jeroen

Posted in Development, ESP8266, Hardware Development, IoT Internet of Things, Network-and-equipment, Power User | Leave a Comment »