智能排课系统vb代码(8)
时间:2025-04-05
时间:2025-04-05
和智能智能排课系统1、2、3是一套
Dim SqlString As String '查询字符串
Dim Connstring As String
Dim msg As String '连接字符串
Private Sub CmdSave_Click()
'进行初始化操作
Dim Counnter As Integer
Connstring = "Driver={SQL
Server};Server=PC2012110412ewr.;Database=GXPK;" _
& "uid =sa;pwd=t123" 'SQL Server普通安全模式建立到Pubs数据库的
连接的连接字符串
'设置连接字符串
With Conn
.ConnectionString = Connstring '给ConnectionString属性赋值
.ConnectionTimeout = 10
.Open '给连接的ConnectionString属性赋值,然后使用求带参数的Open
方法打开连接
End With
MsgBox ("连接成功")
ProgressBar1.Visible = True
ProgressBar1.Max = 200
ProgressBar1.Value = ProgressBar1.Min
msg = MsgBox("您确实要初始化这些数据吗?", vbYesNo)
If msg = vbNo Then Exit Sub
For Counnter = ProgressBar1.Min To ProgressBar1.Max
ProgressBar1.Value = Counnter
If Check1.Value = 1 Then '如果班级信息表被选中
'删除全部提醒信息数据
SQL = "delete from 班级信息表"
Conn.Execute SQL
End If
If Check2.Value = 1 Then '如果课程信息表被选中
'删除全部通讯日志数据
SQL = "delete from 课程信息表"
Conn.Execute SQL
End If
If Check3.Value = 1 Then '如果班级课程信息表被选中
'删除全部群组信息数据
SQL = "delete from 任课表"
Conn.Execute SQL
End If
If Check4.Value = 1 Then '如果教师信息表被选中
'删除全部联系人信息数据
SQL = "delete from 教师信息表"
上一篇:现代高血压药物治疗策略与趋势