请大家帮我看看这段程序,在工程的open事件中为什么始终不可以呢?
string fla
string s_ser
string s_db
string s_id
string s_ps
fla=upper(trim(profilestring("cxc.ini","DATABASE","CON","")))
s_db=profilestring("cxc.ini","DATABASE","DATABASE","")
s_id=profilestring("cxc.ini","DATABASE","USERID","")
s_ser=profilestring("cxc.ini","DATABASE","SERVERNAME","")
str=trim(profilestring("cxc.ini","DATABASE","LOGPASS",""))
s_ps=f_decrypt(str)
IF fla="DIRECT" THEN
SQLCA.DBMS = "MSS Microsoft SQL Server
SQLCA.Database = s_db
SQLCA.UserID = ""
SQLCA.DBPass = ""
SQLCA.LogID = s_id
SQLCA.LogPass = s_ps
SQLCA.ServerName = s_ser
SQLCA.AUTOCommit=false
Connect using SQLCA;
IF SQLCA.SQLCode<>0 THEN
close(w_dl)
open(w_connect)
RETURN
END IF
open(w_dl)
ELSE
IF fla="ODBC" then
SQLCA.DBMS = "ODBC
SQLCA.DBParm = "ConnectString='driver=SQL Server;server="+s_ser+";database="+s_db+";UID="+s_id+";PWD="+s_ps+"'"
SQLCA.AUTOCommit=false
Connect using SQLCA;
IF SQLCA.SQLCode<>0 THEN
close(w_dl)
open(w_connect)
RETURN
END IF
open(w_dl)
else
open(w_connect)
end if
end if
其中:f_decrypt()是自编的解密函数,与加密函数f_endrypt()对应,函数加密解密完全正常,没有出现解密错误!