VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Searching the records in MS-Access database using vb Rate Topic: -----

#1 murali_1311  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 3
  • View blog
  • Posts: 8
  • Joined: 14-September 07


Dream Kudos: 0

Share |

Searching the records in MS-Access database using vb

Posted 14 September 2007 - 07:36 AM

I connected my Visual basic and MS-Access using Add ins manager. Please take a look below

Private Sub Command6_Click()
Dim n, n1 As String
Dim count As Integer
count = Data1.Recordset.RecordCount
txtmax.Text = Data1.Recordset.RecordCount
cnt.Text = 1
n = InputBox("Enter the roll no")
Data1.Recordset.MoveFirst
While Not Data1.Recordset.Fields(1) = n
cnt.Text = cnt.Text + 1
If cnt.Text <= txtmax.Text Then
 Data1.Recordset.MoveNext
Else
MsgBox "Record Not Found"
GoTo a:
End If
Wend
Data1.ShowWhatsThis
a:
End Sub

Here's my question.

Actually i am doing a software using vb and MS-Access. I want to search the database for a particular data, say roll no and if that data is present, it should be displayed in the form. But the problem i am having is that, this coding doesn't shows proper result. So i need your guidance in solving this. I hope i will get a right solution here. Thanks in Advance.
Was This Post Helpful? 1


#2 PsychoCoder  Icon User is offline

  • iHater.Init(this);
  • Icon

Reputation: 1364
  • View blog
  • Posts: 19,696
  • Joined: 26-July 07


Dream Kudos: 12925

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

Re: Searching the records in MS-Access database using vb

Posted 14 September 2007 - 08:55 AM

First, are you using VB6 or VB.Net (Vb 2005)?
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users