how to connect the ms sql server 2K on ubuntu system?

Forum related to MS SQL Server

Moderators: gto, cipto_kh, EgonHugeist

charles_zou
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 03.06.2007, 04:26

how to connect the ms sql server 2K on ubuntu system?

Post by charles_zou »

I get the error message miss ntwdblib.dll when I connect the ms sql server.
who can help me?
Bottleneck
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 09.08.2006, 09:48

Post by Bottleneck »

Hello charles_zou,

download following file

http://www.galileocomputing.de/dateien/ ... stenID-243

Save in "windows\system32" directory. Should work now.
charles_zou
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 03.06.2007, 04:26

Post by charles_zou »

I mean the Linux system "Ubuntu", not the windows system.
charles_zou
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 03.06.2007, 04:26

Post by charles_zou »

should I use odbc to connect the ms sql server?
charles_zou
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 03.06.2007, 04:26

Post by charles_zou »

I found a file and modified it. it will connect the ms sql server 2005,now.
charles_zou
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 03.06.2007, 04:26

Post by charles_zou »

it's the file I used.
You do not have the required permissions to view the files attached to this post.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Thanks for the patch. It doesn't compile on my Windows/Delphi7 installation, however.
Fails on

Code: Select all

  OldErrorHandle := dberrhandle(ErrorHandle);
  OldMessageHandle := dbmsghandle(MessageHandle);
with message
[Error] ZPlainDbLibMsSql7.pas(785): Incompatible types: 'Calling conventions differ'
[Error] ZPlainDbLibMsSql7.pas(786): Incompatible types: 'Calling conventions differ'
[Fatal Error] ZPlainDbLibDriver.pas(867): Could not compile used unit '..\..\src\plain\ZPlainDbLibMsSql7.pas'
Do you know what's wrong? When I have a working version on both Linux and Windows, I'll certainly commit it.

Mark
AndyK
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 19.11.2008, 00:35

Post by AndyK »

I am attempting to connect to SQL Server from Linux, and I am not certain how to proceed. Was the new ZPlainDbLibMsSql7.pas file ever rolled into the ZeosLib release? If not, how do I include the update into my copy of the components (I don't know how to rebuild the package)? And what do I need to set the TZConnection object properties to in order to connect ... I have tried setting the Protocol to "mssql" (which works on Windows) but I still get the error "None of the dynamic libraries can be found: ntwdblib.dll"?

Thanks, Andy
Michael
ZeosLib's Handyman :o)
ZeosLib's Handyman :o)
Posts: 189
Joined: 15.08.2005, 16:08
Location: Wehrheim
Contact:

Post by Michael »

Hi Guys,

just one question since I'm not an Ubuntu (Linux) user: How is the Windows environment on your Linux installation implemented? Or: How do you run Delphi7 under Ubuntu? If you haven't any possibility to access the SQL-Server protocols/drivers or ADO you will imho get no connection to MSSQL ...
:prog2: Use the source, dude!

[align=right]..::.. ZeosLib on SourceForge ..::..[/align]
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Michael,

There's always lazarus. No need for Delphi on Linux. :D

AndyK,

The question remains : what system driver are you using to connect with MSSQL. Is there a ntwdblib.dll equivalent available for Ubuntu or is there an ADO implementation available?
Anyhow, I don't believe Zeoslib can find the necessary libraries on Ubuntu yet. Extra development will be needed to add this.
If it's just about pointing to a linux version of ntwdblib.dll this shouldn't be difficult. Just adding the right name to the plainloader class as long as the entry points are available in the library.
If we must enable ADO support this might require more work as ADO protocol isn't available on Lazarus yet.

Mark
Image
Michael
ZeosLib's Handyman :o)
ZeosLib's Handyman :o)
Posts: 189
Joined: 15.08.2005, 16:08
Location: Wehrheim
Contact:

Post by Michael »

Hi Mark,

the things you mentioned were also my last State: Since the ADODB-Unit is not implemented in Lazarus, yet we have no chance to get ADO running in ZEOS on Lazarus ... right? So we have to wait for the Lazarus guys ... i suppose! :(
:prog2: Use the source, dude!

[align=right]..::.. ZeosLib on SourceForge ..::..[/align]
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post by btrewern »

All,

I'm pretty sure there is no such thing as ADO on Linux so we can't expect much from the Lazarus team regarding that.

The only way I can find to access MS SQL server fron *nix is via http://www.freetds.org/. This includes a standard library and an ODBC driver so it's a start. As I understand it, a new protocol would need to be created in Zeos to use this library.

Regards,

Ben
AndyK
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 19.11.2008, 00:35

Post by AndyK »

Mark,

Thank you for your reply ... this is the best glimmer of hope that I have had with this problem! I can see the"DLL_LOCATION = 'ntwdblib.dll'" line in the file ZPlainDbLibMsSql7.pas file, and it seems that the file "libsybdb.so" is the equivalent of that DLL in FreeTDS. So I just need to change that "ntwdblib.dll" to "libsybdb.so" on that line in the ZEOS source? And after changing it how do I incorporate this into Lazarus (that is, what do I choose from the Lazarus menu to rebuild/reload the ZEOS package with that change in place).

Again, thank you for helping me with this!

Andy
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

AndyK,

There's quite a lot of conditions to get this work.
- The dll must have the same names for the entry points of all function.
- The buffers must have the same dimensions.
- The protocol used by FreeTDS must be of the same verion as your server used (is the FreeTDS project still active?)

I think the easiest way to get the modified zeoslib version active in Lazarus is to rebuild Lazarus. I think that automatically rebuilds your Zeoslib components when they have changed. If not just open the components package and 'recompile all what's needed by the package'.

Good luck and report here!!

Mark
Image
Michael
ZeosLib's Handyman :o)
ZeosLib's Handyman :o)
Posts: 189
Joined: 15.08.2005, 16:08
Location: Wehrheim
Contact:

Post by Michael »

@All:

In order to get the Zeos Components rebuilt you have to rebuild Lazarus ... b u t ... before that you also have to delete the files in [font=Courier New]\packages\lazarus\build[/font] ... then you can be sure that Lazarus also recompiles the ZeosLib with the modified code.

Also from me: Good Luck!
:smartass:
:prog2: Use the source, dude!

[align=right]..::.. ZeosLib on SourceForge ..::..[/align]
Post Reply