以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]莫名其妙的问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=159666)

--  作者:blsu33
--  发布时间:2021/1/4 7:01:00
--  [求助]莫名其妙的问题
老师,
  出现系统锁死的情况,貌似就是系统问题异常中断运行;然后正在切换数据源,还用了SaveConfigValue GetConfigValue获取保存了的数据连接字符串,然后就好像断在那里,进不去。

Dim str1 As String=GetConfigValue("opencon_test","")

Dim str2 As String=GetConfigValue("opencon_user","")

 这块可以看到字符串没有问题,但是   str1 str2  都正常,但是却直接执行的是else 后面的错误提示了

If str1<>"" And str2<>"" Then

    If Connections.TryConnect(str1) = True And Connections.TryConnect(str2) = True Then

        If Connections.Contains("test") Then

            Connections.Delete("test")

            Connections.add("test",str1)

        Else

            Connections.add("test",str1)

        End If

       

        If Connections.Contains("suser") Then

            Connections.Delete("suser")

            Connections.add("suser",str2)

        Else

            Connections.add("suser",str2)

        End If

    

    Else

        MessageBox.Show("加载数据库有误,请联系开发者,进行优化不能连接!","错误",MessageBoxButtons.OK,MessageBoxIcon.Error)

        e.Cancel=True

        Syscmd.Project.Exit(False)

    End If


--  作者:有点蓝
--  发布时间:2021/1/4 9:11:00
--  
代码在什么事件?什么时候调用的SaveConfigValue?
--  作者:blsu33
--  发布时间:2021/1/4 11:02:00
--  
切换打开数据源
afteropenproject

--  作者:有点蓝
--  发布时间:2021/1/4 11:42:00
--  
如果要删除更改菜单里添加的数据源,必须要先卸载这个数据源所有已经加载的表