Welcome, Guest
Username: Password: Remember me
Components and Libraries for Database Development, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

Cannot open TMSSQLConnection component. 6 years 8 months ago #10955

  • David Scambell
  • David Scambell's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 10
  • Thank you received: 0
Hi,

I am attempting to create an example database application which will connect to 'MS SQL Server'.

I have tried to use both the TSQLConnector and TMSSQLConnection components, but on both counts I receive the error 'Can not load DB-Lib client library "dblib.dll". Check your installation.'.

I have searched the internet for a resolution for this problem and found the latest version of the library could be downloaded from the FPC ftp server, dated 7th Feb 2017.

ftp://ftp.freepascal.org/fpc/contrib/windows/

After extracting the files, I then copied the 32bit files to the Windows\System32 directory and the 64bit files to the \SysWOW64 directory.

I have also copied all of the files to the application build directory.

This however, has had no effect on the error, I would be grateful for any help with this issue, I think I am missing something very simple!

Attachments:

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

Cannot open TMSSQLConnection component. 6 years 8 months ago #10956

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Thanks Sir
Please try
to use from C:\codetyphon\fpcsrc\packages\dblib\src\dblib.pp
the InitialiseDBLib function

for sample:
uses ..., ...,
        dblib,
      ... ... ... ;


 InitialiseDBLib(c:\testdir\dblib.dll);

at start up of your app OR
on main form onGreate (FormCreate) event
PilotLogic Architect and Core Programmer

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

Last edit: by Sternas Stefanos.

Cannot open TMSSQLConnection component. 6 years 8 months ago #10957

  • David Scambell
  • David Scambell's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 10
  • Thank you received: 0
Would I place this command in the applications main form 'OnCreate' function or in the applications *.ppr file?

In any case, I am receiving this error from within the IDE, I wish to use the connection to display sample data at design time?

Dave.S

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

Cannot open TMSSQLConnection component. 6 years 8 months ago #10958

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Sir

First set
MSSQLConnection1
property Connected = false;

In the applications main form 'OnCreate'

use InitialiseDBLib function to load dblib.dll
from the directory you want (for sample InitialiseDBLib(c:\testdir\dblib.dll);

if dblib.dll loaded OK then
set
MSSQLConnection1.Connected = true;

Please study the source of C:\codetyphon\fpcsrc\packages\dblib\src\dblib.pp
PilotLogic Architect and Core Programmer

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

Last edit: by Sternas Stefanos.

Cannot open TMSSQLConnection component. 6 years 8 months ago #10959

  • David Scambell
  • David Scambell's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 10
  • Thank you received: 0
Sternas, Thanks for your reply.

I think that we were both typing at the same time on the set of messages.

Just waiting for CT6.2 to install.

Dave.

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

Last edit: by David Scambell.

Cannot open TMSSQLConnection component. 6 years 8 months ago #10960

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Ok Sir
PilotLogic Architect and Core Programmer

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

Cannot open TMSSQLConnection component. 6 years 7 months ago #10962

  • David Scambell
  • David Scambell's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 10
  • Thank you received: 0
Ok, it has taken a while but I think that I have fixed the problem, at both design and run time by using the alternative library as 'dblib.dll' still refuses to load..

1. Downloaded the 'ntwdblib.dll' library form this web site, www.dlldownloader.com/ntwdblib-dll/ .

Note: The command line functions used to de-register and then re-register the library from the registry as shown on this site did not work for me, but were not required.

2. Copied the file to both the Windows\System32 and \SysWOW64 directories.

3. Loaded the file '\CodeTyphon\fpcsrc\packages\dblib\scr\dblib.pp' into the CodeTyphon source editor.

4. Un-edited the definition on line 32.
{$DEFINE ntwdblib}

5. Used CodeTyphon Center to rebuild IDE and FPC, both 32 & 64bit versions.

The library is now loaded by the IDE and the components can use live data at design time.

For run-time execution, I simply copied the library to the applications root directory and then initialized using 'InitialiseDBLib' as posted by Sternas.

Thank you for your help Sternas.

ps: How do you mark a topic as resolved on the forum?

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

Last edit: by David Scambell.

Cannot open TMSSQLConnection component. 6 years 7 months ago #10963

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Thanks Sir

PS:Edit topic subject like [resolved]
PilotLogic Architect and Core Programmer
The following user(s) said Thank You: David Scambell

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

Cannot open TMSSQLConnection component. 6 years 7 months ago #10967

  • fredvs
  • fredvs's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 205
  • Thank you received: 1
Hello Sternas.

InitialiseDBLib(c:\testdir\dblib.dll)


Ha, you did dynamic loading of library for DBlib --> That is *** great ***. :)

And it fixes, in one shot, all the problems of static linking and bug in "external" declaration.

May I ask you if you are in plan to do conversion of all static fpc-packages into dynamic packages ?

If yes, IMHO, this is a **BIG** change and (IMHO again), you should rename fpc into ctc.

My 0,00001 cent.

Fre;D

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

Last edit: by fredvs.

Cannot open TMSSQLConnection component. 6 years 7 months ago #10968

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
My friend we have a lot of plans

look at
codetyphon\fpcsrc\packages\sqlite\src\sqlite3.pp
codetyphon\fpcsrc\packages\sqlite\src\sqlite3db.pas
codetyphon\fpcsrc\packages\sqlite\src\sqlite3static.pp

it's dynamic link too
PilotLogic Architect and Core Programmer

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

  • Page:
  • 1