********再不回答要死人了!********(天津市的,我请你吃饭,行吗?)

redcoral 2001-05-27 10:09:00
********再不回答要死人了!谁能提供Sql Server 的DB-Library For Borland C++ 3.1 的*.LIB文件,多谢了!用在DOS下用写的程序连接Sql Server,和C/C++的测试程序,包括*.H 和*.LIB文件,是SQL SERVER 6.5版的!(好像微软6.5后就不再提供DOS支持库了)********(天津市的,我请你吃饭,行吗?)



********再不回答要死人了!谁能提供Sql Server 的DB-Library For Borland C++ 3.1 的*.LIB文件,多谢了!用在DOS下用写的程序连接Sql Server,和C/C++的测试程序,包括*.H 和*.LIB文件,是SQL SERVER 6.5版的!(好像微软6.5后就不再提供DOS支持库了)********



不知道为什么在编译时有以下的错误,希望大家帮忙帮忙再帮忙!


注:此为Borland C++ 3.1下测试程序编译错误:


Linking TESTSQL.EXE:
Linker Error: Undefined symbol GETNODE in module DBEXTERN


源程序如下:

#define DBMSDOS
#include <stdio.h>
#include <dos.h>
#include <sqlfront.h>
#include <sqldb.h>

main()
{

PDBPROCESS dbproc;
PLOGINREC login;
DBCHAR bookname[100];
DBCHAR bookcode[100];

dbinit ();

login = dblogin ();
DBSETLUSER (login, "sa");
DBSETLPWD (login, "");

dbproc = dbopen (login, "server");

dbcmd (dbproc, "SELECT b_name, b_code FROM dept_book..bookinfo");

dbsqlexec (dbproc);

if (dbresults (dbproc) == SUCCEED)
{
dbbind (dbproc, 1, NTBSTRINGBIND, 0, bookname);
dbbind (dbproc, 2, NTBSTRINGBIND, 0, bookcode);

while (dbnextrow (dbproc) != NO_MORE_ROWS)
{
printf ("%s from %s\n", bookname, bookcode);
}
}

dbexit ();
return (0);
}







提供者:除这180分外,答后一定再加180分好吗。多谢了!


QQ:25857100

小弟邮箱coral-wei@china.com多谢了!
...全文
213 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
redcoral 2001-05-27
  • 打赏
  • 举报
回复
都做了呀!
  • 打赏
  • 举报
回复
你的问题肯定是头文件以及lib文件不匹配的问题,可惜我找不到sql的老盘,
180分也只好@@喽....
  • 打赏
  • 举报
回复
7. Select the Options menu, choose Compiler, then Advanced Code Generation.
Ensure that the Generate Underbars box is checked. If this option is
unchecked, Borland linker errors similar to the following will occur:

Linker Error: Undefined symbol dbinit in module SQLTEST.C
有没有做呢?
redcoral 2001-05-27
  • 打赏
  • 举报
回复
多谢各位了,帮帮忙吧~~~~~~~~~~~~~~
  • 打赏
  • 举报
回复
都是来自于7。0的,就有问题了。微软修改了函数原型的定义。
不过手边好像找不到6.5的盘....
redcoral 2001-05-27
  • 打赏
  • 举报
回复
各位,哪位知道谁连接成功,能不能帮忙找一下,多谢了,非常着急!
seesi 2001-05-27
  • 打赏
  • 举报
回复
实在不行的话,『据一个曾经成功连接的网友说,需要6.0以下的的版本不知道是不是! 』降级SQL Server!
redcoral 2001-05-27
  • 打赏
  • 举报
回复
能不能帮忙找一下*.H文件,是不是我这个文件坏了,我的这些文件是从7.0的目录下拷出来的~!
redcoral 2001-05-27
  • 打赏
  • 举报
回复
编译模式没错呀!
redcoral 2001-05-27
  • 打赏
  • 举报
回复
都加了!不行呀,据一个曾经成功连接的网友说,需要6.0以下的的版本不知道是不是!
  • 打赏
  • 举报
回复
还要选择正确的编译模式,等等。
这是微软的解决方案,绝对没问题。
  • 打赏
  • 举报
回复
你多半是没有将lib文件加入项目中

. Select the Project menu, choose Add Item. In the File Name box of the Add To
Project List dialog box, type the directory (C:\SQL\DBLIB\LIB by default) and
file name of the appropriate DB-Library .LIB library file:

a. For Windows, use W3DBLIB.LIB

b. For medium model MS-DOS, use BMDBLIB.LIB

c. For large model MS-DOS, use BLDBLIB.LIB

then use the Add button to include the file in the project. Ensure that the
appropriate .LIB file is now listed in the Project window.

  • 打赏
  • 举报
回复
它说是会产生类似的连接错误。
你先照着试试么
redcoral 2001-05-27
  • 打赏
  • 举报
回复
那我的连接错误是什么意思呢?
  • 打赏
  • 举报
回复
还有问题么?
  • 打赏
  • 举报
回复
TITLE :INF: Using DB-Library with Borland C++
PRODUCT :Microsoft SQL server
PROD/VER:4.2
OPER/SYS:
KEYWORDS:kbprogramming

======================================================================
-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft SQL Server Programmer's Toolkit, version 4.2
-------------------------------------------------------------------------------

SUMMARY
=======

Using DB-Library for Microsoft Windows and MS-DOS with Borland C++ version 3.1
requires a few additional steps to configure correctly.

MORE INFORMATION
================

Follow these steps to create a Borland C++ project for a DB-Library
application:

1. Select the Options menu, choose Directories. Include the directory where the
DB-Library .H header files are located (C:\SQL\DBLIB\INCLUDE by default) in
the Include Directories box. Include the directory where the DB-Library .LIB
library files are located (C:\SQL\DBLIB\LIB by default) in the Library
Directories box.

2. Select the Project menu, choose Open Project. Pick an appropriate project
File Name, using the Directories list box to specify the directory where the
application's C/C++ source code files reside.

3. Select the Options menu, choose Application. Pick the appropriate application
option button:

a. For Windows, pick Windows App or Windows DLL

b. For MS-DOS, pick DOS Standard

4. Select the Project menu, choose Add Item. In the File Name box of the Add To
Project List dialog box, type the directory (C:\SQL\DBLIB\LIB by default) and
file name of the appropriate DB-Library .LIB library file:

a. For Windows, use W3DBLIB.LIB

b. For medium model MS-DOS, use BMDBLIB.LIB

c. For large model MS-DOS, use BLDBLIB.LIB

then use the Add button to include the file in the project. Ensure that the
appropriate .LIB file is now listed in the Project window.

5. Include the C/C++ application's source code files in the project.

6. For MS-DOS, select the Options menu, choose Compiler, then Code Generation.
From the Model list, choose the appropriate memory model:

a. For medium model MS-DOS, pick Medium

b. For large model MS-DOS, pick Large

7. Select the Options menu, choose Compiler, then Advanced Code Generation.
Ensure that the Generate Underbars box is checked. If this option is
unchecked, Borland linker errors similar to the following will occur:

Linker Error: Undefined symbol dbinit in module SQLTEST.C

8. For Windows, select the Options menu, choose Linker, then Settings. Ensure
that both Case-Sensitive Link and Case-Sensitive Exports are checked. If
either of these options are unchecked, Borland linker errors similar to the
following will occur:

Linker Error: Undefined symbol _dbinit in module SQLTEST.C

9. For Windows, select the Options menu, choose Compiler, then Entry/Exit Code.
NOTE: Windows all functions exportable is the default. If either Windows
explicit functions exported or Windows DLL explicit functions exported is
chosen, the application's DB-Library error and message handlers must be
declared using the Borland C++ __export keyword. Failure to do can result in
a general protection fault (GP fault) inside the application's DB-Library
error or message handler.

Additional query words: dblib

======================================================================
Keywords : kbprogramming
Technology : kbSQLServSearch kbAudDeveloper kbSQLServPTK420
Version : 4.2

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO
EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION
OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1999.

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧