|
|
#4
zhaoyun11282013-03-31 11:27
建一个ini文件,把连接信息配置进去
然后读取ini文件就可以
string ls_file
ls_file=".\cashier.ini"
SQLCA.DBMS = ProfileString(ls_file,"database","DBMS"," ")
SQLCA.Database = ProfileString(ls_file,"database","DataBase"," ")
SQLCA.LogID = ProfileString(ls_file,"database","LogID"," ")
SQLCA.LogPass = ProfileString(ls_file,"database","LogPassword"," ")
SQLCA.ServerName = ProfileString(ls_file,"database","ServerName"," ")
SQLCA.UserID = ProfileString(ls_file,"database","UserID"," ")
SQLCA.DBPass = ProfileString(ls_file,"database","DatabasePassword", " ")
SQLCA.Lock = ProfileString(ls_file,"database","Lock"," ")
SQLCA.DbParm = ProfileString(ls_file,"database","dbparm"," ")
SQLCA.autocommit = false
connect using SQLCA;
if SQLCA.sqlcode <> 0 then
messagebox("错误提示","数据库连接失败,请检查配置文件"+SQLCA.sqlerrtext)
else
open(w_login)
end if
|