Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 18th, 2007, 02:12 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default Object Variable Not Set????

The code below seems to produce an error saying that the object variable is not set or with block variable not set! Error code '91' I believe.

Code:
Sub Read_XML(sPath As String)
Dim cXml As New ChilkatXml
Dim i As Integer
Dim itm As ListItem

cXml.LoadXml sPath

For i = 0 To cXml.NumChildren

Dim xxNode As ChilkatXml
Set xxNode = cXml.GetChild(i)
    Set itm = frmLibrary.lstLib.ListItems.add(, xxNode.GetAttributeValue(i), xxNode.GetChildWithTag("Title").Content)
        itm.SubItems(1) = xxNode.GetChildWithTag("Artist").Content
        itm.SubItems(2) = xxNode.GetChildWithTag("Album").Content
        itm.SubItems(3) = xxNode.GetChildWithTag("Genre").Content
        itm.SubItems(4) = xxNode.GetChildWithTag("Length").Content


Next i

End Sub
Any reasons why?


------------------------------------------------
Apocolypse2005
Always ready and waiting to be helped!
__________________
Apocolypse2005, I'm a programmer - of sorts.
 
Old August 19th, 2007, 02:59 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

I know why, its because the
Code:
NumChildren
is 0 so no records are selected!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Object variable or With block variable not set I_Chappers ASP.NET 2.0 Basics 3 June 26th, 2008 04:15 PM
Object variable or With block variable not set haidee_mccaffrey Classic ASP Professional 5 March 8th, 2007 03:34 PM
Object Variable or With Block Variable not Set Parbish BOOK: Beginning VB.NET Databases 5 July 13th, 2005 04:03 AM
Object variable or with block variable not set spacy ASP.NET 1.x and 2.0 Application Design 0 September 21st, 2004 12:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.