Monday, March 12, 2012

Problem of MS SQL -ntwdblib.lib NOT found

Dear all,

I want to use C program to connect MS SQL server.
I copied some sample file to install on my computer.
When I run the program, an error occurred, which is about ntwdblib.dll
not find in some paths.
But when I check the paths again, they have ntwdblib.dll.
When I run my C program in another computer, it works...

so , I feel very frustrated.

In my C program, I include the following libraries.
#defineDBNTWIN32
#include "windows.h"
#include <sqlfront.h>
#include <sqldb.h>
#include <stdio.h
Also, I don't know the meaning of "#defineDBNTWIN32".
I haven't installed SQL Client on my computer. Is it the main
problem??

Pls help!!

Cheers,
Alanalan (cheung_yuklun@.i-cable.com) writes:
> I want to use C program to connect MS SQL server.
> I copied some sample file to install on my computer.
> When I run the program, an error occurred, which is about ntwdblib.dll
> not find in some paths.
> But when I check the paths again, they have ntwdblib.dll.
> When I run my C program in another computer, it works...
> so , I feel very frustrated.
> In my C program, I include the following libraries.
> #define DBNTWIN32
> #include "windows.h"
> #include <sqlfront.h>
> #include <sqldb.h>
> #include <stdio.h>
> Also, I don't know the meaning of "#define DBNTWIN32".
> I haven't installed SQL Client on my computer. Is it the main
> problem??

Yes, that is the problem. NTWDBLIB.DLL is the DLL for DB-Library, which
is not part of MDAC, so SQL connectivity is about the only way to install
it.

DB-Library is a very good client library, but unfortunately Microsoft
does not agree, so they stopped developmet of DB-Lib many years ago.
As a consequence, you have restricted support for new features in
SQL Server with DB-Library.

Unless you have some legacy software you are working with, I'd recommend
you to use ODBC or OLE DB instead.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment