Oracle returning wrong datatype.

  • Thread starter Mantaraya via AccessMonster.com
  • Start date
M

Mantaraya via AccessMonster.com

Hi,

I'm trying to add branches to TreeView Control.
If I do this with Access tables than I have no problem and everything works
fine.
But if I try it with Oracle tables it wont work.

"My" code is


'================= AddBranch Sub Procedure =========================
' Recursive Procedure to add branches to TreeView Control
'Requires:
' ActiveX Control: TreeView Control
' Name: xTree
'Parameters:
' rst: Self-referencing Recordset containing the data
' strPointerField: Name of field pointing to parent's primary key
' strIDField: Name of parent's primary key field
' strTextField: Name of field containing text to be displayed
'================================================= ==================
Sub AddBranch(rst As DAO.Recordset, strPointerField As String, _
strIDField As String, strTextField As String, _
Optional HigherOrganisationID As Variant)
On Error GoTo errAddBranch
Dim nodCurrent As Node, objTree As TreeView
Dim strCriteria As String, strText As String, strKey As String
Dim nodParent As Node, bk As String
Set objTree = Me!xTree.Object
xTree.Style = tvwTreelinesPlusMinusText ' Style 6.
xTree.LineStyle = tvwRootLines 'Linestyle 1.

If IsMissing(HigherOrganisationID) Then ' Root Branch.
strCriteria = strPointerField & " Is Null"
Else ' Search for records pointing to parent.
strCriteria = BuildCriteria(strPointerField, _
rst.Fields(strPointerField).Type, _
"=" & HigherOrganisationID)
Set nodParent = objTree.Nodes("a" & HigherOrganisationID)
End If
' Find the first emp to report to the boss node.
rst.FindFirst strCriteria
Do Until rst.NoMatch
' Create a string with LastName.
strText = rst(strTextField)
strKey = "a" & rst(strIDField)
If Not IsMissing(HigherOrganisationID) Then 'add new node to the parent
Set nodCurrent = objTree.Nodes.Add(nodParent, _
tvwChild, strKey, strText)
Else ' Add new node to the root.
Set nodCurrent = objTree.Nodes.Add(, , strKey, _
strText)
End If
' Save your place in the recordset so we can pass by ref for
' speed.
bk = rst.Bookmark
' Add employees who report to this node.
AddBranch rst, strPointerField, strIDField, strTextField, _
rst(strIDField)
rst.Bookmark = bk ' Return to last place and continue search.
rst.FindNext strCriteria ' Find next employee.
Loop
exitAddBranch:
Exit Sub
'--------------------------Error Trapping --------------------------
errAddBranch:
MsgBox "Can't add child: " & Err.Description, vbCritical, _
"AddBranch Error:"
Resume exitAddBranch
End Sub

The problems that I'm running in is that the 'ismissing' in the Oracle
variant never returns true. Instead it gives me """ Also if I check the
typename it gives me 'string' instead of 'error'

The second problem I have is that :
rst.Fields(strPointerField).Type give me 20 with Oracle but with Access I
get 4 (wich works).

Anybody any clue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Problem with Tree View 2
treeView key change tracking 10
Problem with Treeview code 3
TreeView BOM (Error #35602) 6
Unique Key in Treeview 2
Treeview 4
Filtering Sub Form 1
no one is helping... 2

Top