Doubt in treeview control

[b][red]This message was edited by ramya_c2004 at 2005-1-9 22:41:39[/red][/b][hr]
hai

I am using a treeview control which is connected to a database in mysql.Now my problem is when i execute my program it displays an error message as "Type Mismatch" or "key is not unique in column constarint"

Below is the codings i am using and i marked where i get this error.It occurs when the loop executes in first time itself.

Dim Rfund As New ADODB.Recordset
Dim rscheme As New ADODB.Recordset
Dim licount As Integer
Dim licountj As Integer
Dim ndchild As Node
Dim ndparent As Node
Private Sub Form_Load()
Tree.Nodes.clear
Tree.LineStyle = tvwTreeLines
Rfund.Open "select fname,fid from fund where availid ='L' order by fid", con, adOpenStatic, adLockOptimistic
'THE VALUES OF THESE TABLES ARE FOR ROOT
licounti = 1
While Not Rfund.EOF
licountj = 0
rscheme.Open "select sid,sname from scheme where fid=" & Rfund.fields("fid") & " ", con, adOpenStatic, adLockOptimistic
'THE VALUES OF THESE TABLES ARE FOR CHILD
Set ndparent = Tree.Nodes.Add(, , "P" & CStr(licounti), CStr(Rfund.fields(0))) '*'BUT I GET AN ERROR HERE AS "TYPE MISMATCH OR KEY IS NOT UNIQUE IN COLUMN CONSTRAINT CHECK FOR VALUES AT BELOW THIS CODE
'HERE I AM ADDING THE ROOT NODES

While Not rscheme.EOF
'ADDING CHILD NODE TO PARENT
Set ndchild = Tree.Nodes.Add(ndparent, "C" & CStr(licounti) & CStr(licountj), rscheme.fields(1))
licountj = licountj + 1
rscheme.MoveNext
Wend
licounti = licounti + 1
Rfund.MoveNext
Wend
Rfund.Close
rscheme.Close
'THE VALUES ARE
'RFUND.FIELDS('FNAME')='ABN AMRO MUTUAL Fund'
'rfund.fields('fdi')=101
'rscheme.fields('sid')=102
'rscheme.fields('sname')='ABN AMRO DIVIDEND FUND'
End Sub


bye
Ramya

Anbody help me to solve this problem




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories