Lazarus

Programming => Databases => Topic started by: Zath on April 03, 2013, 11:03:32 pm

Title: dblib.dll
Post by: Zath on April 03, 2013, 11:03:32 pm
My attempts at creating a MS SQL connection or ODBC connection keep failing sayin I need dblib.dll.
I have now managed to find it.
Excuse my ignorance but what do I do with it now ?
I'm using v1.0.8
FPC2.62
SVN 40573
i386-win32-win32/win64

Thank you.
Title: Re: dblib.dll
Post by: Lacak2 on April 04, 2013, 07:15:27 am
dblib.dll is needed only for TMSSQLConnection
(for TODBCConnection you do not need it)
Just put this dll into your application directory.
(where is your  compiled EXE)
Title: Re: dblib.dll
Post by: Zath on April 06, 2013, 01:42:17 am
dblib.dll is needed only for TMSSQLConnection
(for TODBCConnection you do not need it)
Just put this dll into your application directory.
(where is your  compiled EXE)

Thanks but it still fails.
Title: Re: dblib.dll
Post by: BigChimp on April 06, 2013, 07:32:42 am
No idea what you mean by "it" or "fails"

http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F
Title: Re: dblib.dll
Post by: Zath on April 06, 2013, 01:05:31 pm
No idea what you mean by "it" or "fails"

http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

If I create a basic form with an MSSQL connection component on it, populate it's settings for the database, leave Connected as false, it compiles as a blank form. Fine.
If I then try and compile it with the MSSQL component Connection property set to true, it says it can't find the dll it needs.

Here's a screenshot.

Title: Re: dblib.dll
Post by: BigChimp on April 06, 2013, 01:56:57 pm
Screenshot seems to show you're not compiling but switching on the connected property to true while in design-time.

IIRC, the dll should then be in the Lazarus directory. Another alternative is to put it in the system directory, which I do on my dev machine.

When you compile the program, once again the dll needs to be in the search path (e.g. the system directory) or the executable directory.

This applies to all dlls used with Lazarus - or at least all database drivers.
Title: Re: dblib.dll
Post by: anis2505 on May 06, 2013, 03:47:28 pm
Screenshot seems to show you're not compiling but switching on the connected property to true while in design-time.

IIRC, the dll should then be in the Lazarus directory. Another alternative is to put it in the system directory, which I do on my dev machine.

When you compile the program, once again the dll needs to be in the search path (e.g. the system directory) or the executable directory.

This applies to all dlls used with Lazarus - or at least all database drivers.

Hi sorry for waking this issue again from the dead BUT I have the dlls it's on my project directory side by side with the executable but no chance I did compiled lots of time but still the same error metioned by Zath

Thanks in advance

regards
Title: Re: dblib.dll
Post by: marcov on May 06, 2013, 08:02:12 pm
Read the comments better. If you set the connection's enable property to true designtime, then both the Lazarus IDE and the application must find the DLL.

Title: Re: dblib.dll
Post by: anis2505 on May 06, 2013, 08:18:04 pm
Read the comments better. If you set the connection's enable property to true designtime, then both the Lazarus IDE and the application must fine the DLL.

Take it easy.
My problem isn't on open or closed connection my problem is the executable doesn't detect the dlls.
Title: Re: dblib.dll
Post by: Pascaluvr on May 06, 2013, 09:34:36 pm
Ansi - if the connection wasn't set to Open then Laz wouldn't need to find the DLL.

On a Windows 7 system (that I am guessing you have) - place the DLL in c:\Windows\SysWOW64
Title: Re: dblib.dll
Post by: anis2505 on May 07, 2013, 10:13:10 am
Hi

Now I get this error
Quote
Server name not found in configuration files
Unknown host name machine

The same configuration work fine for VS ASP.NET, Real studio, HeidiSQL and of-course SQL Server Management Studio.

So please someone provide me with an example of correct configuration.

Thanks in advance and sorry for bother and BTW again take it easy "MARCOV" :).
Title: Re: dblib.dll
Post by: marcov on May 07, 2013, 02:08:13 pm
Take it easy.
My problem isn't on open or closed connection my problem is the executable doesn't detect the dlls.

I suspected the Lazarus IDE might want to load the DLL at the moment a connection goes live, or if you try to edit fields (populating with schema data from the database-> connection).

What other packages do is irrelevant. Put a copy of the DLL (1) next to the application (2) next to the IDE (3) a place where both applications search.

In the case that you have mixed 32-bit/64-bit environments, please note so.
Title: Re: dblib.dll
Post by: Zath on July 03, 2013, 07:38:56 pm
Just thought I'd bump this again.

The same error has appeared again after installing the latest Lazarus version.

Can't this dll be included with lazarus so it is made available when using these components ?
Title: Re: dblib.dll
Post by: goodname on July 04, 2013, 04:25:48 pm
Can't this dll be included with lazarus so it is made available when using these components ?

I'm sure MS would not be happy about other projects or companies distributing their dll's. Know of a MS boot CD that had this issue and basically ended up saying go to the install CD you got with your windows operating system to get the required dll files.

Even if they could legally include the dll there is no way to know which SQLServer version your running and dll's usually change with the server version it is connecting to.

In the end it is MS job to provide the basic ability to connect to their product. Lazarus has provided the wrapper to be able to use that basic connection tool. If you find a problem connecting to a specific dll version then let the Lazarus project people know so they can do something about the wrapper.
Title: Re: dblib.dll
Post by: BigChimp on July 04, 2013, 04:47:59 pm
Except dblib.dll is not an MS dll in this case; it can be generated by FreeTDS.

See here:
http://wiki.lazarus.freepascal.org/mssqlconn
and here for a download location:
ftp://ftp.freepascal.org/fpc/contrib/windows/
Title: Re: dblib.dll
Post by: BigChimp on July 04, 2013, 04:50:09 pm
Even if they could legally include the dll there is no way to know which SQLServer version your running and dll's usually change with the server version it is connecting to.
Nope, because the TDS protocol hasn't changed (that much). FreeTDS connects to a lot of different versions of MSSQL, as well as Sybase ASE.
Title: Re: dblib.dll
Post by: BigChimp on July 04, 2013, 04:56:21 pm
Can't this dll be included with lazarus so it is made available when using these components ?

You are welcome to file a feature request via the bug tracker... however:
1. Where shall we stop? Ship all Firebird, PostgreSQL etc dlls as well? If Oracle was open source, what about including the 100s of megs of the so-called Instant Client dlls?
2. This won't help much in getting the dll included in your application directory. A solution, installing in your Windows system directory, won't help when your customers get the application and miss the DLL.

Given that, I'd just put dblib.dll in the appropriate windows system (32 or 64 bits depending on DLL) directory of your dev machine and forget about it (except of course when distributing your database programs to others).
Title: Re: dblib.dll
Post by: goodname on July 04, 2013, 08:21:12 pm
Was not aware that someone had written a connection dll independent of MS. That changes the politics. Agree with BigChimp comments on this.
Title: Re: dblib.dll
Post by: jack616 on August 14, 2013, 01:31:20 pm

Tip for configuring - applies to mySQL so I assume it does to others:

1. Stick with keeping the dll in the program directory (just keeps things simpler)
2. Ensure you have the correct release version of the dll eg mysql5.0 or mySql5.5  or whatevr db you use etc
that matches a) your program and b)your server and c) to the os you are compiling to
3. BIG tip - If compiling 32bit ensure you use the 32bit dll or 64bit dll when compiling with 64bit lazarus

It is very easy to get the wrong word size file. Also for mySQL people notice there may be 2 different
sized versions of the dll with the same name on your machine in different places - generally - ensure you use the big one.

Hope thats helpful.
Title: Re: dblib.dll
Post by: BigChimp on September 03, 2013, 01:09:36 pm
Some good ideas, but some caveats as well ;)

Tip for configuring - applies to mySQL so I assume it does to others:
Assumptions are the mother of all... never mind.

1. Stick with keeping the dll in the program directory (just keeps things simpler)
This will bite you when trying to connect in design-time... as has been amply demonstrated in earlier posts on this thread.

Myself, I just copy my dll to the windows system directory on my dev machine and forget about it... except that you need to remember to put the dll in the program directory when giving the compiled program to other people.

2. Ensure you have the correct release version of the dll eg mysql5.0 or mySql5.5  or whatevr db you use etc
that matches a) your program and b)your server and c) to the os you are compiling to
This advice is invalid for MySQL as well: re b): your mysql *CLIENT* dll version should match the unit name in your FPC code. The client version can differ from the server version (though it's up to mysql to indicate what's supported).

For MS SQL Server/Sybase ASE with FreeTDS dlls, it's recommended to use a fairly recent dll, e.g. the one provided as a courtesy on the FPC server (see links elsewhere). That single DLL should work for MS SQL 2000..2008 and probably 2012 (and probably really old versions) and Sybase ASE at least 12.5..15.

3. BIG tip - If compiling 32bit ensure you use the 32bit dll or 64bit dll when compiling with 64bit lazarus
Yes, that completely applies to FreeTDS dlls as well (in fact, AFAIU any dlls on Windows should match bitness with the program that calls them)

Thanks,
BigChimp
Title: Re: dblib.dll
Post by: ikutluay on September 16, 2013, 03:50:24 pm
Hello.. Can i use the 32bit dblib.dll on my wince device? it is m3 mobile arm processor device....

wince version is 5.
Title: Re: dblib.dll
Post by: LacaK on September 18, 2013, 06:04:32 am
Can i use the 32bit dblib.dll on my wince device?
No, from this location ftp://ftp.freepascal.org/fpc/contrib/windows/
There are versions precompiled for Win32 and Win64 targets , not for WinCE
TinyPortal © 2005-2018