实时错误94
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sql As String
Dim oter1() As String
Dim oter2() As String
Dim i As Integer
Dim cardcode() As String
Dim cardname() As String
Set con = New Connection
con.CursorLocation = adUseClient
con.Open "driver={SQL SERVER};server=server;pwd=760522;uid=sa;database=sbo_gymy_2007 "
sql = "select descript,territryID from oter "
Set rs = New Recordset
Set rs = con.Execute(sql)
'给combo1赋值
i = 0
While Not rs.EOF
Combo1.AddItem (rs(0))
rs.MoveNext
i = i + 1
Wend
sql = " "
Set rs = Nothing
sql = "select cardname,cardcode from ocrd "
Set rs = con.Execute(sql)
'给combo2赋值
While Not rs.EOF
Combo2.AddItem (rs(0))-----> 实时错误94,无效使用 null
rs.MoveNext
Wend
'rs.Close
Set rs = Nothing
con.Close
[解决办法]
rs(0)是NULL值?