网上下的pb源码如何连接配置数据库啊
2个回答
展开全部
sqlca.DBMS = ProfileString (ls_startupfile, "database", "dbms", "")
sqlca.Database = ProfileString (ls_startupfile, "database", "database", "")
sqlca.Logid = ProfileString (ls_startupfile, "database", "logid", "")
sqlca.Logpass = ProfileString (ls_startupfile, "database", "LogPassWord", "")
sqlca.ServerName = ProfileString (ls_startupfile, "database", "Servername", "")
sqlca.UserID = ProfileString (ls_startupfile, "database", "Userid", "")
sqlca.DBPass = ProfileString (ls_startupfile, "database", "DatabasePassword", "")
sqlca.Lock = ProfileString (ls_startupfile, "database", 'Lock', '')
sqlca.DBParm = ProfileString (ls_startupfile, "database", "DBParm", "")
/* Uncomment the following for actual DB connection */
connect using sqlca;
if sqlca.sqlcode <> 0 then
MessageBox ("Cannot Connect to Database", sqlca.sqlerrtext)
return
end if
sqlca.autocommit = true
toolbartext=true
主要就是这几句代码、连接sql server的、在ini文件中配置数据库相关信息、如果是access也和这里差不多、数据库用名字、连接不上就改成ip
sqlca.Database = ProfileString (ls_startupfile, "database", "database", "")
sqlca.Logid = ProfileString (ls_startupfile, "database", "logid", "")
sqlca.Logpass = ProfileString (ls_startupfile, "database", "LogPassWord", "")
sqlca.ServerName = ProfileString (ls_startupfile, "database", "Servername", "")
sqlca.UserID = ProfileString (ls_startupfile, "database", "Userid", "")
sqlca.DBPass = ProfileString (ls_startupfile, "database", "DatabasePassword", "")
sqlca.Lock = ProfileString (ls_startupfile, "database", 'Lock', '')
sqlca.DBParm = ProfileString (ls_startupfile, "database", "DBParm", "")
/* Uncomment the following for actual DB connection */
connect using sqlca;
if sqlca.sqlcode <> 0 then
MessageBox ("Cannot Connect to Database", sqlca.sqlerrtext)
return
end if
sqlca.autocommit = true
toolbartext=true
主要就是这几句代码、连接sql server的、在ini文件中配置数据库相关信息、如果是access也和这里差不多、数据库用名字、连接不上就改成ip
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询