If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
TYPE MISMATCH listview VB6
I have written a code(VB6 ADO) 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(
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.