求助:关于vb与sql 建立一个简单的学生管理系统 调试遇到的各种问题
程序代码:
Public m As String Public i As String Dim txtsql As String Dim conn As New ADODB.Connection Dim mrc As New ADODB.Recordset Public n As Integer Public Function exesql(ByVal sql As String) As ADODB.Recordset Dim conn As ADODB.Connection Dim rst As ADODB.Recordset sql = Trim$(sql) sql = "select * from wgbf" Set conn = New ADODB.Connection Set rst = New ADODB.Recordset conn.ConnectionString = "Provider=SQLOLEDB.1; Password=sa;User ID=sa; Initial Catalog=pubs; Data Source=127.0.0.1" conn.Open Set rst.ActiveConnection = conn rst.LockType = adLockOptimistic rst.CursorType = adOpenKeyset rst.Open sql 试调错误指在这里 Set exesql = rst Set rst = Nothing Set conn = Nothing End Function
调试的时候 他说 实时错误’-2147217865 (80040e37)‘对象名'wgbf'无效
我一直都找不到 wgbf在哪。。。。
郁闷。。。
快期末了这是数据库老师布置的作业,用vb跟sql做一个简单的数据库系统。
小弟我vb没学过,弄了一天把代码差不多弄完了,调试总出问题。。。
大侠快来帮帮我吧。
[ 本帖最后由 keejo 于 2010-6-6 13:14 编辑 ]