Recent

Author Topic: TMSSQLConnection - sqlDB component for accessing MS SQL Server  (Read 140748 times)

mdbs99

  • Full Member
  • ***
  • Posts: 121
  • Software Engineer. Husband. Trader.
    • website
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #150 on: March 16, 2012, 12:33:16 pm »
The TMSSQLConnection component was committed in rev 20522!   8-)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #151 on: March 27, 2012, 11:13:55 am »
Thanks for getting it into FPC.

I've created (ugly) Sybase and MS SQL Server connectors for the Lazarus component palette.
See
http://bugs.freepascal.org/view.php?id=21578
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #152 on: March 29, 2012, 04:25:55 pm »
Heads up: started on fpdoc documentation for Sybase & MS SQL Server connectors.
See https://bitbucket.org/reiniero/fpc_laz_patch_playground/src, directory docs, mssqlconn.xml

When I'm done, I'll upload the result here for review before submitting a patch....

Thanks,
BigChimp
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #153 on: March 29, 2012, 08:10:22 pm »
First stab (basically copied readme contents).

Attached resulting .chm; source is in repository mentioned earlier.

@Lacak2, Ludo: the readme has this under Known problems:
Quote
(create temporary stored procedures for prepared statements)
Can't remember what that one is. Does it mean that preparing a parameterized query won't work? Or won't give any performance benefits?

Next up: writing up the various ways you can connect to sql server: in other words: explain that you can specify instance names in the database field (e.g. .\SQLEXPRESS, IIRC - can't remember if that works with freetds)... and remembering/looking up where the port number goes.

Also, I'll try and add references/links as appropriate.

Note that the help is very short; most of it is inherited from the parent class.

As usual, comments welcome...

Thanks,
Bigchimp

Thanks.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Lacak2

  • Guest
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #154 on: March 30, 2012, 08:19:16 am »
(create temporary stored procedures for prepared statements)
Can't remember what that one is. Does it mean that preparing a parameterized query won't work? Or won't give any performance benefits?
Ignore it ATM, it was only my comment to some way which I have thought about

Next up: writing up the various ways you can connect to sql server: in other words: explain that you can specify instance names in the database field (e.g. .\SQLEXPRESS, IIRC - can't remember if that works with freetds)... and remembering/looking up where the port number goes.
Look at begining of mssqlconn.pp:
    TMSSQLConnection properties:
      HostName - can be specified also as 'servername:port' or 'servername\instance'
And: http://www.freetds.org/userguide/portoverride.htm

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #155 on: March 30, 2012, 09:34:20 pm »
Thanks Lacak!
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #156 on: April 04, 2012, 08:21:47 am »
Submitted as http://bugs.freepascal.org/view.php?id=21643

FPC trunk currently won't allow building documents (bug 21621) so no chm file.
However, you can copy the .xml file in one of the directories defined in Lazarus Tools/Optionis/FPDoc Editor/"FPDoc Settings"... this should show at least context-sensitive help (e.g. hovering your mouse over a TMSSQLConnection should show something).
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #157 on: April 06, 2012, 04:39:28 pm »
Hi guys,

Can I install this component now in the current version of Lazarus?  I didn't see download link, but I might have missed it.

Thanks,
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #158 on: April 06, 2012, 05:03:16 pm »
Yes, it should work on current SVN/trunk version.

Edit: A recent snapshot will also work. the snapshots are based on 2.6/2.6.1 - sorry, I don't think the mssqlconn connector is already in there...
« Last Edit: April 08, 2012, 12:43:21 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

nomorelogic

  • Full Member
  • ***
  • Posts: 165
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #159 on: April 07, 2012, 07:26:01 pm »
hi all
I think it's a very interesting component and I'd like to test it

I'm using a snapshot
lazarus 0.9.30-2build1 (2011-07-06)
FPC 2.4.4
revision 29738
i386-linux-gtk 2
on ubuntu 32 bit

donwoaded source from
https://bitbucket.org/reiniero/fpc_laz_patch_playground/src

during pasql.lpr project compilation I receive following error:
mssqlconn.pp(756,57) Error: Identifier not found "FSQLFormatSettings"

missing some code?

thanks

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #160 on: April 08, 2012, 12:44:23 pm »
FPC 2.4.4
...
during pasql.lpr project compilation I receive following error:
mssqlconn.pp(756,57) Error: Identifier not found "FSQLFormatSettings"

missing some code?
I think FSQLFormatsetinngs must be introduced in a later version of FPC... that's why it won't work...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

nomorelogic

  • Full Member
  • ***
  • Posts: 165
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #161 on: April 08, 2012, 04:23:14 pm »
forgive me, I mistakenly thought it was a property introduced in donwloaded project :)


snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #162 on: April 13, 2012, 10:40:22 pm »
Ya, I am getting the same error.  Do we need FCP 2.6 minimum?
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #163 on: April 13, 2012, 10:44:59 pm »
One more question, is this a visual component that goes in the pallet or is it just a library?
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TMSSQLConnection - sqlDB component for accessing MS SQL Server
« Reply #164 on: April 14, 2012, 08:44:08 am »
There is an FPC connection (i.e. non-visual). That's been added to FPC 2.7.1 (SVN trunk) but will quite probably work on FPC 2.6.0/fixes 2.6/2.6.1 (and won't work without change on 2.4.4 - see nomorelogic's post).
You can look at the bug report mentioned to download the code, or get the code from the FPC trunk repository:
http://svn.freepascal.org/svn/fpc/trunk/packages/fcl-db/src/sqldb/mssql/
Edit: You'd also have to get a new registersqldb.pas
(You'd have to fiddle with the make files, perhaps at http://svn.freepascal.org/svn/fpc/trunk/packages/fcl-db/src/sqldb/)

Then there's a visual/GUI component in the Lazarus pallette that requires the FPC component - so it needs FPC trunk/2.7.1 or a patched FPC 2.6.x.
See my post earlier with the bug report and associated code. Once again, you can download the code from the patch or via the repository.

Edit: In other words, if you have Lazarus trunk with FPC trunk, both the visual and non-visual components are there.

Regards,
BigChimp
« Last Edit: April 14, 2012, 10:11:40 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018