Recent

Author Topic: ZEOS Component  (Read 3680 times)

Stag76

  • New Member
  • *
  • Posts: 35
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

  • Sr. Member
  • ****
  • Posts: 370
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 2.0.8 FPC 3.0.4 Linux Mint Mate 19.3
Zeos 7̶.̶2̶.̶6̶ 7.1.3a-stable - Sqlite 3.32.3 - LazReport

Stag76

  • New Member
  • *
  • Posts: 35
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

  • Sr. Member
  • ****
  • Posts: 297
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 last version free pascal last version
Lazarus trunk  free pascal trunk 
System : Linux mint  64bit  Windows 7 64bit

miab3

  • Full Member
  • ***
  • Posts: 145
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: 35
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.

 

TinyPortal © 2005-2018