wjcayh81 发表于 2006-12-1 20:21

请教:pb与SQL连接

<P>我是新手请问各位高手怎么用ini文件连接SQL库呀<BR>怎么写呀代码和ini文件怎么写呀?<BR>谢谢各位了!!!!!!!!!!!!![em03]</P>

tzy21 发表于 2007-7-9 16:46

回复:(wjcayh81)请教:pb与SQL连接

<P>在INI文件里这样设置<BR>[database]<BR>DBMS=MSS Microsoft SQL Server 6.x<BR>Database=csmd_new_hm<BR>UserId=<BR>DatabasePassword=<BR>LogPassword=<BR>ServerName=.<BR>LogId=sa<BR>Lock=<BR>DbParm=<BR>Prompt=0</P>

<P><BR>在PB中这样写<BR>DISCONNECT USING SQLCA ;</P>
<P>SQLCA.DBMS       = ProfileString(gs_ini_path, "DataBase", "DBMS", " ")<BR>SQLCA.Database   = ProfileString(gs_ini_path, "DataBase", "DataBase", " ")<BR>SQLCA.LogID      = ProfileString(gs_ini_path, "DataBase", "LogID", " ")<BR>SQLCA.LogPass    = ProfileString(gs_ini_path, "DataBase", "LogPassword", " ")<BR>SQLCA.ServerName = ProfileString(gs_ini_path, "DataBase", "ServerName", " ")<BR>SQLCA.UserID     = ProfileString(gs_ini_path, "DataBase", "UserID", " ")<BR>SQLCA.DBPass     = ProfileString(gs_ini_path, "DataBase", "DatabasePassword", " ")<BR>SQLCA.Lock       = ProfileString(gs_ini_path, "DataBase", "Lock", " ")<BR>SQLCA.DbParm     = ProfileString(gs_ini_path, "DataBase", "DbParm", " ")<BR>CONNECT USING SQLCA ;</P>

页: [1]

编程论坛