首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

C连数据库的有关问题

2012-03-04 
C连数据库的问题 #defineDBNTWIN32#include stdio.h#include windows.h#include sqlfront.h#include

C连数据库的问题

#define   DBNTWIN32
#include <stdio.h>
#include <windows.h>
#include <sqlfront.h>
#include <sqldb.h>

main()
{
        DBPROCESS   *dbproc;
        LOGINREC   *login;
       
dbinit();

login   =   dblogin();

if(login   =   NULL)
{
return   1;
}

DBSETLUSER(login,   "lx ");
                DBSETLPWD(login,   "123 ");

dbproc   =   dbopen(login,   ". ");

}

用上面代码连数据库,为什么dbproc老是NULL,就是老连不上,上面步骤有问题吗?

[解决办法]
是的


还有
if(login = NULL) //应该是 "== "吧.

热点排行