The following lines were added (+) and removed (-):
== Example: Read from Access Database and Populate an Array == Public cn1 As ADODB.Connection txtSourcePath.Text = App.Path & "\Contact.mdb" Private Sub cmdConnect_Click() Dim strConn1 As String Set cn1 = New ADODB.Connection cn1.ConnectionString = strConn1 cn1.Open End Sub Private Sub MakeCompanyArray() Dim strSQL1 As String, cnt As Integer Set rs1 = New ADODB.Recordset strSQL1 = "SELECT * FROM Company ORDER BY CompanyID" rs1.CursorLocation = adUseClient rs1.Open strSQL1, cn1, adOpenKeyset, adLockOptimistic If rs1.RecordCount > 0 Then For cnt = 1 To rs1.RecordCount arCompanies(cnt, 1) = rs1!CompanyID arCompanies(cnt, 2) = rs1!CompanyName arCompanies(cnt, 3) = rs1!PhoneNum arCompanies(cnt, 4) = rs1!Website rs1.MoveNext Next cnt arCompanies(0, 1) = cnt End If rs1.Close Set rs1 = Nothing End Sub