I am completely new to Access and Databases (and limited ability with VB6 as well) but don't let that put you off.
I am using VB6 and Access 2002
I have downloaded the tutorial suggested in the FAQ's and run it in a practise project and got it all to work as should be.
I have now tried to put this code into my project, which is making a Code Library for myself.
The first thing I am trying to accomplish is to load the list in the attached image under the title tvwNodes into an array, to then use to name the Nodes in my treeview (tvwCode)
I have the following code where I get an error after all the 6 records have been added to the array
"Run-time error 94"
"Invalid use of Null"
My code is:
vb Code:
'declare it as a ADO-DB
Set cn = New ADODB.Connection
'set the connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Documents and Settings\Andrew\My Documents\VB6\New Code Library\DBCL.mdb"
cn.Open
Set rs = New ADODB.Recordset
rs.Open "tbl_Nodes", cn, adOpenKeyset, adLockPessimistic, adCmdTable
'move to first record
rs.MoveFirst
'loop to add items to array
ReDim tvw_Nodes(0)
Do Until rs.EOF = True
tvw_Nodes(UBound(tvw_Nodes)) = rs.Fields("tvwNodes")
Debug.Print tvw_Nodes(UBound(tvw_Nodes))
rs.MoveNext
ReDim Preserve tvw_Nodes(UBound(tvw_Nodes) = 1)
Loop
Could this be because the list in the second field is longer?
I wouldn't have thought so, but as I said in my first line of this thread ...

Originally Posted by
Me
I am completely new to Access and Databases