How to search data from Oracle?

I have developed a system in Lotus Notes (Client) and want to search data from Oracle table. When user enter his personal no then all his details come to other field like his name, dept etc. I have used some code but there is no any error but it also not fetching data…Please help.

I used this code but its not woking…

Dim con As New ODBCConnection

Dim qry As New ODBCQuery

Dim res As New ODBCResultSet

Dim qry1 As New ODBCQuery

Dim res1 As New ODBCResultSet

Dim wrk As New notesuiworkspace

Dim session As New NotesSession

Dim db As NotesDatabase



Set uidoc=wrk.currentdocument

Set db=session.CurrentDatabase

Set docw=uidoc.document



m1= docw.frmpno(0)

If Len(m1) <> 6Then

	Msgbox "You Have Entered " & Len(m1) & " characters in Personal No. Please Check !!!"

	Call uidoc.gotofield("frmpno")

	Exit Sub

End If

If con.connectto("oprjusco","office","office") Then

	

	'Msgbox "Connected to the Database............."

Else

	Msgbox "Unable to connect to the database !"

	Exit Sub

End If



Set qry.Connection=con

Set res.Query=qry



Set qry1.Connection=con

Set res1.Query=qry1



qry.SQL = "SELECT EM_FSTNAME FROM EMPL WHERE EM_PERNO= '" & m1 & "'"

res.Execute

If res.IsEndOfData Then

	Call uidoc.Fieldsettext("frmname","Invalid Number.")

	Exit Sub

End If

efname = res.GetValue(1)



qry.SQL = "SELECT EM_LSTNAME FROM EMPL WHERE EM_PERNO= '" & m1 & "'" 

res.Execute

elname = res.GetValue(1)



'qry.SQL = "SELECT EM_DESGN FROM EMPL WHERE EM_PERNO= '" & m1 & "'"

'res.Execute

'empdept = res.GetValue(1)



qry.SQL = "SELECT EM_COST_CENTERCD FROM EMPL WHERE EM_PERNO='" & m1 & "'"

res.Execute

empcostcenter = res.GetValue(1)



m2=empcostcenter



qry1.SQL = "SELECT CST_CENTER_DETAIL FROM COST_CENTER WHERE CST_CENTER='" & m2 & "'"

res1.Execute

empdept = res1.GetValue(1)



empname = efname+" "+elname



Call uidoc.FieldSetText("frmname", empname)

Call uidoc.FieldSetText("frmdept",empdept)

End Sub

Subject: RE: How to search data from Oracle ?

Please read: Debugging Domino Applications part 1 and part 2 and try to find out where the script is doing something different from what you expect.