go to next/previous record [vb 2005]

odeh83

New member
Joined
Apr 26, 2006
Messages
3
Programming Experience
Beginner
hi guys, I've got a table MS Access which I display its records from my asp page, the problem is I don't know how to go create a next/ previous button which navigates through the records, here is a sample of how my asp page displays the data in the form:

VB.NET:
Dim connectString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Inetpub\wwwroot\AGTEMP\AGTPS.MDB"
Dim cn As OleDbConnection = New OleDbConnection(connectString)
'Open Connection.
cn.Open()
Dim selectString As String = "SELECT TS_nStatus, TS_nPhotoId, TS_nFACode, TS_cEnFirstName, " _
& "TS_cEnSecondName,TS_cEnThirdName, TS_cEnFourhtName, TS_cEnFamilyName,TS_cArFirstname, TS_cArSecondName," _
& "TS_cArThirdName, TS_cArFourthName, TS_cArFamilyName, TS_dBirthDate, TS_cQID, TS_nGender, TS_cPassportNo," _
& "TS_dPassExpiryDt, TS_cMobile, TS_cEmail, TS_cActivationReason FROM TempStaff"
Dim cmd As OleDbCommand = New OleDbCommand(selectString, cn)
Dim reader As OleDbDataReader = cmd.ExecuteReader()
While (reader.Read())
TextBox1.Text = reader("TS_cEnFirstName").ToString()
TextBox4.Text = reader("TS_cEnSecondName").ToString()
TextBox8.Text = reader("TS_cEnThirdName").ToString()
TextBox9.Text = reader("TS_cEnFourhtName").ToString()
TextBox10.Text = reader("TS_cEnFamilyName").ToString()
TextBox3.Text = reader("TS_nPhotoId").ToString()
End While
reader.Close()
cn.Close()
End Sub
 
Last edited by a moderator:
Back
Top