Many had been asking about how to view records this tells how to view records from database.
Private Sub Command7_Click()
'code for view
On Error GoTo q
Dim viewv As Integer
viewv = InputBox("enter the voter id")
On Error GoTo w
'again you type it in a line this code runes
rsv.Open "select id,name,address,age,gender,dob from voter where id=' " & viewv & " '", conv, adOpenDynamic, adLockOptimistic
Text5.Text = rsv.Fields("id")
Text2.Text = rsv.Fields("name")
Text3.Text = rsv.Fields("address")
Combo1.Text = rsv.Fields("age")
If (rsv.Fields("gender") = "male") Then
Option1.Value = True
ElseIf (rsv.Fields("gender") = "female") Then
Option2.Value = True
End If
DTPicker1.Value = rsv.Fields("dob")
If (rsv.State = 1) Then
rsv.Close
End If
MsgBox "view"
Exit Sub
q: MsgBox "you cancelled"
Exit Sub
w: MsgBox "value not present in database"
End Sub
Private Sub Command7_Click()
'code for view
On Error GoTo q
Dim viewv As Integer
viewv = InputBox("enter the voter id")
On Error GoTo w
'again you type it in a line this code runes
rsv.Open "select id,name,address,age,gender,dob from voter where id=' " & viewv & " '", conv, adOpenDynamic, adLockOptimistic
Text5.Text = rsv.Fields("id")
Text2.Text = rsv.Fields("name")
Text3.Text = rsv.Fields("address")
Combo1.Text = rsv.Fields("age")
If (rsv.Fields("gender") = "male") Then
Option1.Value = True
ElseIf (rsv.Fields("gender") = "female") Then
Option2.Value = True
End If
DTPicker1.Value = rsv.Fields("dob")
If (rsv.State = 1) Then
rsv.Close
End If
MsgBox "view"
Exit Sub
q: MsgBox "you cancelled"
Exit Sub
w: MsgBox "value not present in database"
End Sub
Are you using Procedure or Trigger for viewing data ?
ReplyDeletei am not using procedure or trigger to view data just viewing data using select statement of oracle.
ReplyDeletetype it in a line like this in continous manner
ReplyDeletersv.Open "select id,name,address,age,gender,dob from voter where id=' " & viewv & " '", conv, adOpenDynamic, adLockOptimistic
Excellent pieces. Keep posting such kind of information on your blog. I really impressed by your blog.
ReplyDeletedo u have ER diagram for this voting system?....plz post it
ReplyDeletem not using trigger n function ten how i conneect the table from sql to vb
ReplyDelete