网上下的pb源码如何连接配置数据库啊
发布网友
发布时间:2022-12-03 23:04
我来回答
共2个回答
热心网友
时间:2023-11-19 13:49
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
热心网友
时间:2023-11-19 13:49
是没有配置ODBC吧 控制面板里面找到ODBC建立一个SQL的连接,然后在PB里面脸上建立的ODBC就可以了