注册 登录
编程论坛 VB6论坛

odbc驱动程序不支持所需的属性,求帮助

baobeitian91 发布于 2013-11-28 16:36, 307 次点击
Private Sub Form_Load()
    Dim Random As Integer
    Randomize
    Random = Int((Rnd * 30) + 1)
    Dim Sql
    Sql = "select * from Validation where id='" & Random & "'"
    Dim Res As New ADODB.Recordset
    Res.Open Sql, Conn, 1, 1
    R_random.Caption = Res("validation")
End Sub
代码没有编完,编到这运行就报错了
上面为代码,到res.open sql,conn,1,1报错
引用的是MADO2.8L
数据库中的对应名称没有错误,求帮忙
3 回复
#2
vbvcr512013-11-28 19:35
好像conn没有定义。
#3
Artless2013-11-29 11:55
Conn
#4
vbvcr512013-11-29 18:52
Dim Res As New ADODB.Recordset后面添加下面这条语句,你试试看.
Dim conn As New Connection
1