Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共7 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:如何一个系统,登陆时,不同客户通过机构代码实现链接不同数据库

1楼
weibu 发表于:2023/12/17 20:24:00
如何一个系统,登陆时,不同客户通过机构代码实现链接不同数据库?
老师我现在自己建立的登陆窗口,加载时都要卸载和重新装载表,这样去更换数据源。导致登陆很慢,并且网络有不稳定,报错概率很大。
老师,能否实现客户端登陆一次后保存此次登陆的数据链接字符串。
下次直接登陆了
2楼
有点蓝 发表于:2023/12/17 20:26:00
把登录后的链接字符串保存到一个文本文件里。每次登录前先读取这个文本文件有没有链接字符串,如果有就直接使用,没有再让用户选择
3楼
weibu 发表于:2023/12/17 22:24:00
老师我在BeforeConnectOuterDataSource写的如下代码,并建立了对应的文本文件,建立文本是也做了对应加密处理,为啥登陆后还是链接的老的数据源,
Dim ipFile As String = e.ProjectPath & "project\CplicationPathlog.txt"
If e.Name = "olddate" Then
    If Filesys.FileExists(ipFile) Then
        Dim Val As String = FileSys.ReadAllText(ipFile)
        Dim ip As String = DecryptText(Val, "y14", "ww#") '解密
        e.ConnectionString = ip
        MessageBox.Show(ip)   '而且打开发布后的软件并未弹出消息

    End If
End If
4楼
有点蓝 发表于:2023/12/17 22:29:00
调试

Dim ipFile As String = e.ProjectPath & "project\CplicationPathlog.txt"
msgbox(e.Name) ‘数据源名称正确吗
If e.Name = "olddate" Then
    If Filesys.FileExists(ipFile) Then
msgbox(1) '能不能弹出
        Dim Val As String = FileSys.ReadAllText(ipFile)
msgbox(Val )
        Dim ip As String = DecryptText(Val, "y14", "ww#") '解密
        e.ConnectionString = ip
        MessageBox.Show(ip)   '而且打开发布后的软件并未弹出消息

    End If
End If
5楼
weibu 发表于:2023/12/17 22:37:00
老师数据源名称确认无误,  msgbox(1) '不能弹出
6楼
有点蓝 发表于:2023/12/17 22:40:00
Dim ipFile As String = e.ProjectPath & "project\CplicationPathlog.txt"
改为
Dim ipFile As String = e.ProjectPath & "CplicationPathlog.txt"
7楼
weibu 发表于:2023/12/17 22:49:00
可以了,谢谢老师
共7 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02734 s, 2 queries.