Recent

Author Topic: ZEOS Component  (Read 660 times)

Stag76

  • New Member
  • *
  • Posts: 33
ZEOS Component
« on: July 26, 2019, 01:34:14 am »
I've written a simple application that accesses an MSSQL DataBase using ZEOS Components.
I've copied the .exe and ntwdblib.dll to another machine, but I can't get it to run.
It errors stating that the SQL Server Does not exist.
If I compile the application on the target machine, it runs OK, verifying the SQL Server etc.

Is there any library etc. associated with ZEOS Components that needs to be copied to the target machine.

GAN

  • Full Member
  • ***
  • Posts: 230
Re: ZEOS Component
« Reply #1 on: July 26, 2019, 03:11:54 am »
You must link the location of the library in the TZConnection.LibraryLocation property, by code (before connecting) or by using the Object inspector.

Code: Pascal  [Select]
  1. ZConnection1.LibraryLocation:=Application.Location+'ntwdblib.dll';

If the library is in the same directory of the executable.
Lazarus 1.8.4 FPC 3.0.4 Linux Mint Mate 17.2 x86_64 GTK-2
Zeos 7.1.3 - Sqlite 3.8.2

Foro Lazarus en español http://forum.lazarus.freepascal.org/index.php/board,73.0.html

Stag76

  • New Member
  • *
  • Posts: 33
Re: ZEOS Component
« Reply #2 on: July 27, 2019, 12:03:22 am »
Thanks for the reply.

I've checked the Library Location and it's OK.

I'm going to try Inno-Setup.

nouzi

  • Full Member
  • ***
  • Posts: 140
Re: ZEOS Component
« Reply #3 on: July 27, 2019, 12:28:07 pm »
You can  use

Code: Pascal  [Select]
  1. ZConnection1.LibraryLocation:='ntwdblib.dll';
  2.  
or
Code: Pascal  [Select]
  1. ZConnection1.LibraryLocation:='.\ntwdblib.dll';
  2.  
my english is  bad
Lazarus 2.0 free pascal 3.0.4
Lazarus trunk  free pascal trunk 
System : windows 7 64bit

miab3

  • Full Member
  • ***
  • Posts: 103
Re: ZEOS Component
« Reply #4 on: July 27, 2019, 03:35:17 pm »
I've written a simple application that accesses an MSSQL DataBase using ZEOS Components.
I've copied the .exe and ntwdblib.dll to another machine, but I can't get it to run.
Stop using ntwdblib.dll to connect to MSSQL. This is a very old only Win32 M$ library.
Start using libraries from the project freeTDS or ODBC or OLE DB (the last in Zeos 7.3).
https://www.freetds.org/
https://sourceforge.net/projects/zeoslib/files/3rd%20party/FreeTDS/
ftp.freepascal.org/fpc/contrib/windows/

Michal
« Last Edit: July 27, 2019, 03:53:37 pm by miab3 »

Stag76

  • New Member
  • *
  • Posts: 33
Re: ZEOS Component
« Reply #5 on: August 06, 2019, 09:46:56 am »
Solved - I had left an entry in the SQL component of a TQuery (Select * from dbo.TableName) that I had been using in the "Edit Fields" Process. This was masked when the application was in development mode, but failed when the .exe was deployed on another PC.