Forum

× Components and Libraries for Database Development, discussions, problems and suggestions

Question CodeTyphon connecting to MS SQL Server 2014

  • Felipe Eduardo Ortiz López
  • Felipe Eduardo Ortiz López's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • PASCAL programmers do it recursively...
More
7 months 2 weeks ago #11105 by Felipe Eduardo Ortiz López
CodeTyphon connecting to MS SQL Server 2014 was created by Felipe Eduardo Ortiz López
Hi there!

New to CT, but worked a lot in Delphi, so the style of coding is not a mistery to me..., I connected to Firebird (piece of cake) and Postgres (simple as can be), but I couldn't connect to MS SQL Server 2014 or any other version.

Can you provide me with a tutorial or step-by-step or something to allow me to connect? Working on Win 10-64, MSSQLS 2014, CT 6.3.

____________________________________
Felipe Eduardo Ortiz López.
"A programmer is a biological machine that transforms coffe into code lines."

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
7 months 2 weeks ago - 7 months 2 weeks ago #11106 by Sternas Stefanos
Replied by Sternas Stefanos on topic CodeTyphon connecting to MS SQL Server 2014
Thanks Sir
Did you try to connect to your MS SQL server with
Database Desktop tool ?
with SQLDB direct or
with ODBC ?

pl_ZeosDBO is the next option to connect with a MSSQL Server





CodeTyphon Architect and Programmer
Attachments:
Last edit: 7 months 2 weeks ago by Sternas Stefanos.

Please Log in or Create an account to join the conversation.

More
7 months 2 weeks ago #11107 by usbdoo
Replied by usbdoo on topic CodeTyphon connecting to MS SQL Server 2014
I try this in Firebird.

If table define as


CREATE TABLE "sKonto"
(
"KontoID" varchar(8) NOT NULL,
"Konto" varchar(100) NOT NULL,
"Analitika" char(1),
"KorDat" date,
"Korisnik" varchar(14),
CONSTRAINT "PK_Konto" PRIMARY KEY ("KontoID")
);


not vork

Please Log in or Create an account to join the conversation.

  • Manos S. Pappas
  • Manos S. Pappas's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
More
7 months 2 weeks ago - 7 months 2 weeks ago #11108 by Manos S. Pappas
Replied by Manos S. Pappas on topic CodeTyphon connecting to MS SQL Server 2014

Sternas Stefanos wrote: Thanks Sir
Did you try to connect to your MS SQL server with
Database Desktop tool ?
with SQLDB direct or
with ODBC ?

pl_ZeosDBO is the next option to connect with a MSSQL Server





Hello Mr. Sternas,

Using CT 6.3 final, Database Desktop crashes both on 32-bit and 64-bit of TyphonIDE.
Crash occurs with either option (New Dictionary, new connection etc).

Best Regards,
Manos S. Pappas
Attachments:
Last edit: 7 months 2 weeks ago by Manos S. Pappas.

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
7 months 2 weeks ago - 7 months 2 weeks ago #11109 by Sternas Stefanos
Replied by Sternas Stefanos on topic CodeTyphon connecting to MS SQL Server 2014
Sir
please look in files:

C:\codetyphon\fpcsrc\packages\dblib\src\dblib.pp
**********************************************************************
    FreeTDS (http://www.freetds.org/userguide/choosingtdsprotocol.htm):
      tds version = 5.0 - Sybase System 10 and above
                    7.0 - MS SQL Server 7
                    7.1 - MS SQL Server 2000 (*default*)
                    7.2 - MS SQL Server 2005
                    7.3 - MS SQL Server 2008
                    7.4 - MS SQL Server 2012/2014
      tds version can be set using env.var. TDSVER or in freetds.conf or .freetds.conf
}
unit dblib;

{$IFDEF FPC}{$mode objfpc}{$ENDIF}{$H+}

{ $DEFINE ntwdblib}  //if you are using MS SQL Server Client Library (ntwdblib.dll)
{$IFNDEF ntwdblib}
 {$DEFINE freetds}  //if you are using db-lib from FreeTDS project (MS SQL Server + Sybase support)
{$ENDIF}

{$DEFINE LOAD_DYNAMICALLY}

interface

const
  DBLIBDLL=
{$IFDEF WINDOWS}
  {$IFDEF ntwdblib}'ntwdblib.dll'{$ENDIF}
  {$IFDEF freetds} 'dblib.dll'   {$ENDIF}
{$ELSE}
  {$IFDEF DARWIN}
    'libsybdb.dylib'
  {$ELSE}
    'libsybdb.so'
  {$ENDIF}
{$ENDIF}


C:\codetyphon\fpcsrc\packages\fcl-db\src\sqldb\mssql\mssqlconn.pp
    MS SQL Server Client Library is required (ntwdblib.dll)
    - or -
    FreeTDS (dblib.dll)
      freetds.conf: (http://www.freetds.org/userguide/freetdsconf.htm)
        [global]
        tds version = 7.1
        client charset = UTF-8
        port = 1433 or instance = ...  (optional)
        dump file = freetds.log        (optional)
        text size = 2147483647         (optional)

    TMSSQLConnection properties:
      HostName - can be specified also as 'servername:port' or 'servername\instance'
                 (SQL Server Browser Service must be running on server to connect to specific instance)
      CharSet - if you use Microsoft DB-Lib and set to 'UTF-8' then char/varchar fields will be UTF8Encoded/Decoded
                if you use FreeTDS DB-Lib then you must compile with iconv support (requires libiconv2.dll) or cast char/varchar to nchar/nvarchar in SELECTs
      Params - "AutoCommit=true" - if you don't want explicitly commit/rollback transactions
               "TextSize=16777216" - set maximum size of text/image data returned
               "ApplicationName=YourAppName" - Set the app name for the connection. MSSQL 2000 and higher only
}
unit mssqlconn;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, sqldb, db, BufDataset,
  dblib;


if your PC have dblib.dll all are OK
if your PC have ntwdblib.dll then go to
C:\codetyphon\fpcsrc\packages\dblib\src\dblib.pp and set
in line 32: {$DEFINE ntwdblib}
and Rebuild FPCXX

CodeTyphon Architect and Programmer
Last edit: 7 months 2 weeks ago by Sternas Stefanos.
The following user(s) said Thank You: Manos S. Pappas

Please Log in or Create an account to join the conversation.

  • Felipe Eduardo Ortiz López
  • Felipe Eduardo Ortiz López's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • PASCAL programmers do it recursively...
More
7 months 2 weeks ago #11111 by Felipe Eduardo Ortiz López
Replied by Felipe Eduardo Ortiz López on topic CodeTyphon connecting to MS SQL Server 2014
...and some questions... (thanks for the "sir" part ;) )

* Where I can find (or construct) dblib.dll ?
* Do you have any additional informaion regarding MS SQL conections?

Tried the solution, but as reported above, had an exception. Right now applied the solution and rebuilding the tools and Big IDE (I assume thats the correct building), when its done, I'll try and will be reporting any pending issue. Thanks in advance.

____________________________________
Felipe Eduardo Ortiz López.
"A programmer is a biological machine that transforms coffe into code lines."

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
7 months 2 weeks ago #11112 by Sternas Stefanos
Replied by Sternas Stefanos on topic CodeTyphon connecting to MS SQL Server 2014

CodeTyphon Architect and Programmer

Please Log in or Create an account to join the conversation.

  • Manos S. Pappas
  • Manos S. Pappas's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
More
7 months 2 weeks ago #11114 by Manos S. Pappas
Replied by Manos S. Pappas on topic CodeTyphon connecting to MS SQL Server 2014

Sternas Stefanos wrote: if your PC have dblib.dll all are OK
if your PC have ntwdblib.dll then go to
C:\codetyphon\fpcsrc\packages\dblib\src\dblib.pp and set
in line 32: {$DEFINE ntwdblib}
and Rebuild FPCXX


Thank you for your answer.
Unfortunately, the Database Desktop tool crashes when trying to create a new dictionary.

Best Regards,
Manos S. Pappas
Attachments:

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
7 months 2 weeks ago #11115 by Sternas Stefanos
Replied by Sternas Stefanos on topic CodeTyphon connecting to MS SQL Server 2014
More info Sir
-did you test "dblib.dll" or "ntwdblib.dll" ?
-Typhon32 or Typhon64 ?

CodeTyphon Architect and Programmer

Please Log in or Create an account to join the conversation.

  • Manos S. Pappas
  • Manos S. Pappas's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
More
7 months 2 weeks ago - 7 months 2 weeks ago #11117 by Manos S. Pappas
Replied by Manos S. Pappas on topic CodeTyphon connecting to MS SQL Server 2014

Sternas Stefanos wrote: More info Sir
-did you test "dblib.dll" or "ntwdblib.dll" ?
-Typhon32 or Typhon64 ?


Thank you sir.

- Tried ntwdblib.dll, compiled fine and is detected right. The access violation also appears when the tool is compiled for dblib.dll.
- Both Typhon32 and Typhon64 expose the problem.

Using CT 6.30 final.

Best Regards,
Manos S. Pappas
Last edit: 7 months 2 weeks ago by Manos S. Pappas.

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
7 months 2 weeks ago #11118 by Sternas Stefanos
Replied by Sternas Stefanos on topic CodeTyphon connecting to MS SQL Server 2014
Thanks
we working in a new version of ctdatadesktop
more soon...

CodeTyphon Architect and Programmer
The following user(s) said Thank You: Manos S. Pappas, Felipe Eduardo Ortiz López

Please Log in or Create an account to join the conversation.

  • Felipe Eduardo Ortiz López
  • Felipe Eduardo Ortiz López's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • PASCAL programmers do it recursively...
More
7 months 2 weeks ago #11122 by Felipe Eduardo Ortiz López
Replied by Felipe Eduardo Ortiz López on topic CodeTyphon connecting to MS SQL Server 2014

Sternas Stefanos wrote: Thanks
we working in a new version of ctdatadesktop
more soon...


Well, so my news had became old...

Done everything as requested (changin the file, rebuilding) but no effect, still having the exception...

And I need to connect my application to MS SQL Server. How 'soon' is 'more soon'?

____________________________________
Felipe Eduardo Ortiz López.
"A programmer is a biological machine that transforms coffe into code lines."

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
7 months 2 weeks ago #11123 by Sternas Stefanos
Replied by Sternas Stefanos on topic CodeTyphon connecting to MS SQL Server 2014
Soon is "LAB soon" :)

Please try the new (BETA) ctdatadesktop

and your help please....

CodeTyphon Architect and Programmer
Attachments:
The following user(s) said Thank You: Avra, Manos S. Pappas

Please Log in or Create an account to join the conversation.

  • Manos S. Pappas
  • Manos S. Pappas's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
More
7 months 2 weeks ago - 7 months 2 weeks ago #11126 by Manos S. Pappas
Replied by Manos S. Pappas on topic CodeTyphon connecting to MS SQL Server 2014

Sternas Stefanos wrote: Soon is "LAB soon" :)

Please try the new (BETA) ctdatadesktop

and your help please....


Replaced the CT6.30 one inside the source typhon package, rebuilt everything and it works great both 32 and 64 bit.
Thank you very much :)

Best Regards,
Manos S. Pappas
Attachments:
Last edit: 7 months 2 weeks ago by Manos S. Pappas.

Please Log in or Create an account to join the conversation.