12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- $PBExportHeader$f_connectdb_id.srf
- global type f_connectdb_id from function_object
- end type
- forward prototypes
- global function integer f_connectdb_id (ref string arg_msg)
- end prototypes
- global function integer f_connectdb_id (ref string arg_msg);Int rslt = 1
- //id
- id_sqlca = CREATE Transaction
- id_sqlca.DBMS = "SNC SQL Native Client(OLE DB)"
- id_sqlca.Database = sqlca.database
- id_sqlca.UserID = sqlca.userid
- id_sqlca.DBPass = sqlca.dbpass
- id_sqlca.LogID = sqlca.logid
- id_sqlca.LogPass = sqlca.logpass
- id_sqlca.ServerName = sqlca.servername
- id_sqlca.DBParm = sqlca.dbparm
- id_sqlca.Lock = "RC"
- id_sqlca.AutoCommit = false
- CONNECT USING id_sqlca;
- IF id_sqlca.SQLCode < 0 THEN
- arg_msg = "取ID模块数据连接失败!" + id_sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- EXECUTE IMMEDIATE "set transaction isolation level READ UNCOMMITTED" USING id_sqlca;
- execute immediate 'SET DEADLOCK_PRIORITY low' USING id_sqlca;
- IF id_sqlca.SQLCode <> 0 THEN
- HALT;
- END IF
- ext:
- RETURN rslt
- end function
|