Question

Locked

TYPE MISMATCH listview VB6

By soumyarina ·
Dear sirs,

I have written a code which reads as under:

Dim m_DbName

m_DbName = App.Path
If Right$(m_DbName, 1) <> "\" Then m_DbName = m_DbName & "\"
m_DbName = m_DbName & "Admin.mdb"
Me.txtDbName.Text = m_DbName

Set Conn = New ADODB.Connection
Conn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Me.txtDbName.Text & ";" & _
"Jet OLEDB:Database Password=" & Me.txtPassword.Text
Conn.Open

Set rs = New ADODB.Recordset
rs.Open "CreditNote", Conn, adLockOptimistic ', adCmdText
Do While Not rs.EOF

Set list_item = List.ListItems.add(, , "" & no) ** I get 'Type Mismatch' Error here.
list_item.SubItems(1) = rs!no & ""
list_item.SubItems(2) = rs!DnNo & ""
list_item.SubItems(3) = Format$((rs!Date), "dd MMM yyyy") & ""
list_item.SubItems(4) = rs!Ref & ""
list_item.SubItems(5) = rs!GrAmount & ""
list_item.SubItems(6) = Format$(rs!tax, "0.00") & ""
list_item.SubItems(7) = rs!tPt & ""
list_item.SubItems( = rs!nettAmount & ""
list_item.SubItems(9) = rs!Name & ""

If I use the same code when the Database is not password protected, I get NO Error.

Please help.

Himadri
Himadri S.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums