View Issue Details

IDProjectCategoryView StatusLast Update
0021578PatchesLCLpublic2012-03-31 10:59
ReporterReinier OlislagersAssigned ToMattias Gaertner  
Status closedResolutionfixed 
Product Version0.9.31 (SVN) 
Summary0021578: [Patch] Microsoft SQL Server and Sybase ASE connectors
DescriptionNew Lazarus connector components for the MS SQL Server and Sybase ASE connectors written by Lacak2 that use FreeTDS/dblib (see bug 21571).
Steps To contains a diff; please apply.
Also tsybaseconnection.png and tmssqlconnection.png, to be placed in components\sqldb\design

As a convenience, zip attached with example program, readme and required dlls) for Sybase and MS SQL Server.
Additional InformationI've followed the FPC connector's supported operating systems:
SqldbConnectionOSes = [beos,linux,freebsd,win32,win64,wince,darwin,iphonesim,netbsd,openbsd];
// MS SQL Server and Sybase ASE connectors were introduced in the FPC 2.7 development branch.
// Operating systems should match FPC packages\fcl-db\fpmake.pp

... perhaps there is an easier way of doing this.

Compiled and tested on Lazarus x86 Windows. x64 windows correctly does not show the components with the patch applied.

Finally, my graphics skills are not too good; I'm sure improvements in the icons would be welcome; if so, replace the pngs in components\sqldb\design and rerun registersqldb.bat in the design directory (or run lazres manually).

TagsNo tags attached.
Fixed in Revision36459
Attached Files


related to 0021571 resolvedMattias Gaertner Lazarus Lazbuild syntax error in compileroptions.pp 


2012-03-27 11:12 (2,707 bytes)

2012-03-27 11:12


Reinier Olislagers

2012-03-27 11:13

developer   ~0058104

Note: indicated win32/win64 widgetset as I only tested on those. Freetds/FPC connectors should work on Linux,FreeBSD,OSX etc... so should the Lazarus components...

Ludo Brands

2012-03-27 15:21

developer   ~0058116

Tested on linux64. Encountered a few problems that are probably not related to the component but to mssqlconn (all steps from ide, no code written):
- setting Connected true with wrong username or password or hostname brings up an empty error message (Caption 'Error', the no entry road sign and ok button)
- when connected, activate a query that results in an error (select permission denied in my case), then disconnect results in 'The rollback transaction request has no corresponding begin transaction'. Only way to disconnect is to close the project and reopen it
- entered a hostname with a / instead of \. First try to connect came back after a long while (time-out) with the empty error message. A retry caused lazarus to hang forever. Had to kill the lazarus process.

Reinier Olislagers

2012-03-27 15:40

developer   ~0058117

IIUC, the connection GUI components are indeed thin layers that call the various connection objects, so yes, I'd suspect these are problems with the underlying FPC connector object.
Had a quick look at registersqldb.pas and couldn't find anything to do with what error message is shown...

Had same timeout with incorrect hostname/port; that's probably the same for most of the db connectors... Can't remember error message though - so it must not have been too strange.

Ludo Brands

2012-03-27 17:11

developer   ~0058120

Found 2 reasons for the empty messages:
- Gtk raises a warning 'Failed to set text from markup due to error parsing markup: Error on line 1 char 182: Invalid UTF-8 encoded text in name - not valid'. The message is indeed '... échec de l'ouverture...' with 'é' sent as 0xc9.
- in case of a time-out DBErrorStr and DBMsgStr are simply empty. The errorno is 20002. The empty message for 20002 seems to be a known problem in FreeTDS. Probably the better solution is to precede the error message with something like 'mssqlcon error ##### : ' followed by DBErrorStr and DBMsgStr. I'll create a different issue + patch for that.

Reinier Olislagers

2012-03-27 18:31

developer   ~0058125

Thanks Ludo. IIUC, you're suggesting this patch can be implemented and you (I, we ;) ) will add other patches dealing with
- UTF8 error messages in GTK and
- dealing with error 20002 in FreeTDS

Ludo Brands

2012-03-27 19:08

developer   ~0058126

That is indeed my conclusion regarding Linux: nothing wrong with is patch.


2012-03-29 13:00

developer   ~0058171

For graphic for MS SQL, look at
I do not know if we can use graphic motif or there are any licence restrictions

And IMO it will be good if images will have also "socket" motif (each sqlDB connector has this motif)

Is there in Lazarus team anybody, who covers all "graphic" of IDE?

Mattias Gaertner

2012-03-30 15:58

manager   ~0058191

I would like to add the example. Is there a way to avoid the two dll?

Issue History

Date Modified Username Field Change
2012-03-27 11:12 Reinier Olislagers New Issue
2012-03-27 11:12 Reinier Olislagers File Added:
2012-03-27 11:12 Reinier Olislagers Widgetset => Win32/Win64
2012-03-27 11:12 Reinier Olislagers File Added:
2012-03-27 11:13 Reinier Olislagers Note Added: 0058104
2012-03-27 15:21 Ludo Brands Note Added: 0058116
2012-03-27 15:40 Reinier Olislagers Note Added: 0058117
2012-03-27 17:11 Ludo Brands Note Added: 0058120
2012-03-27 18:31 Reinier Olislagers Note Added: 0058125
2012-03-27 19:08 Ludo Brands Note Added: 0058126
2012-03-28 17:30 Juha Manninen Relationship added related to 0021571
2012-03-29 13:00 LacaK Note Added: 0058171
2012-03-30 15:55 Mattias Gaertner Fixed in Revision => 36459
2012-03-30 15:55 Mattias Gaertner LazTarget => -
2012-03-30 15:55 Mattias Gaertner Assigned To => Mattias Gaertner
2012-03-30 15:55 Mattias Gaertner Status new => resolved
2012-03-30 15:55 Mattias Gaertner Resolution open => fixed
2012-03-30 15:58 Mattias Gaertner Note Added: 0058191
2012-03-31 10:59 Reinier Olislagers Status resolved => closed