求解 实时错误94 无效使用NULL
Dim Conn As New ADODB.ConnectionDim rs_login As New ADODB.Recordset
Sub Data()
On Error GoTo Err
Dbpath = App.Path & "\book.mdb"
ConnectionString = "provider=Microsoft.Jet.oledb.4.0;data source=" & Dbpath
Conn.Open ConnectionString
Err:
If Err.Number Then
MsgBox "数据库出错"
End
End If
End Sub
Private Sub Form_Load()
Call Data
Dim rs_leibie As New ADODB.Recordset
Dim sql As String
sql = "select * from 书刊类别"
rs_leibie.Open sql, Conn, adOpenKeyset, adLockPessimistic
rs_leibie.MoveFirst
Do While Not rs_leibie.EOF
Combo1.AddItem rs_leibie.Fields(0)
rs_leibie.MoveNext
Loop
rs_leibie.Close
End Sub
--------------------编程问答-------------------- Combo1.AddItem "" & rs_leibie.Fields(0)
--------------------编程问答--------------------
Do While Not rs_leibie.EOF
if not isnull(rs_leibie.Fields(0)) then
Combo1.AddItem rs_leibie.Fields(0)
end if
rs_leibie.MoveNext
Loop --------------------编程问答-------------------- Combo1.AddItem rs_leibie.Fields(0) & ""
补充:VB , 数据库(包含打印,安装,报表)