将远程数据库导入到本地(笔记本)数据库,运行项目,登录窗口按确定时出错,退出项目时同样出错,而远程数据库运行正常,问题出在哪里,请各位老师指教,谢谢!!
此主题相关图片如下:e.png
代码如下:
用户登录窗口确定键
Dim cmb As New SQLCommand
Dim dd As Date
cmb.C '外部数据源
cmb.CommandText = "Select GetDate()" '服务器时间
dd = cmb.ExecuteScalar()
cmb.CommandText = "Insert Into {日志} ([用户组],[用户名],[状态],[时间],[设备ID]) Values ('"
cmb.CommandText = cmb.CommandText & _UserGroup & "','" & _UserName & "','" & "登录" & "','" & dd & "','" & ComputerId & "')"
cmb.ExecuteNonQuery()
DataTables("日志").Load()'刷新表
项目属性 BeforeCloseProject
Dim cmb As New SQLCommand
Dim dd As Date
cmb.C '外部数据源
cmb.CommandText = "Select GetDate()" '服务器时间
dd = cmb.ExecuteScalar()
cmb.CommandText = "Insert Into {日志} ([用户组],[用户名],[状态],[时间],[设备ID]) Values ('"
cmb.CommandText = cmb.CommandText & _UserGroup & "','" & _UserName & "','" & "退出" & "','" & dd & "','" & ComputerId & "')"
cmb.ExecuteNonQuery()
DataTables("日志").Load()'刷新表
[此贴子已经被作者于2012-3-1 12:31:13编辑过]