Foxtable(狐表)用户栏目专家坐堂 → SQL数据源


  共有13424人关注过本帖树形打印复制链接

主题:SQL数据源

帅哥哟,离线,有人找我吗?
blackzhu
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章
等级:狐仙 帖子:9879 积分:57634 威望:0 精华:15 注册:2008/9/1 9:45:00
  发帖心情 Post By:2010/9/14 10:50:00 [显示全部帖子]

 

Dim Result As DialogResult

Result = MessageBox.Show("需要保存吗?", "提示", MessageBoxButtons.Yesno, MessageBoxIcon.Question)

If Result = DialogResult.Yes Then

    Dim T1,T2,T3,T4,T5 As String

    T1="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=跟单系统;Data Source=zhujian"

    T2= "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=项目列表;Data Source=zhujian"

    T3="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=装箱单;Data Source=zhujian"

    T4="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=面料出库;Data Source=zhujian"

    T5="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=排期表;Data Source=zhujian"

    Dim Names(4) As String

    Names (0) =t1

    Names (1) = t2

    Names (2) = t3

    Names (3) = t4

    Names (4) = t5

    Dim C1 As New Data.Oledb.OledbConnection(Names(4))

    Try

    C1.Open()

    C1.Close()

    Syscmd.Project.Save()

    Syscmd.Project.Exit()

    Catch ex As Exception

    MessageBox.Show("服务器已关闭,无法保存后退出,请开启服务器!","警告!!!")

End Try

Else

    Syscmd.Project.Exit(False)

End If

 

 

   这个代码是我要退出系统时,判断服务器有没有关闭的代码,你修改着用!


 回到顶部