Ado

Creator

Member
Joined
Aug 14, 2003
Messages
20
I got an Access file with the follow fields,

Name, Date, Time.


in vb.net I declared and connected to Access and got the data in recordset. But I have problem with accessing the field.

in vb6 I can do like this.

MyVar = rs("Date") where rs is the recordset

I tried that but did not work with .net

how do u do it in
 
Below is the code
--------------------------------------------

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim Util As IUtilities.IUtil
Dim dBase As DAO.Database
Dim rsDbase As DAO.Recordset
Dim dbPath As String

Dim sDate As String
Dim sTime As String
Dim sName As String

Util = CreateObject("IUtilities.IUtil")

dbPath = "C:\SITRA\Databases\Database.mdb"

return recordset I HAVE CHECKED IT RETURN OK
rsDbase = Util.dbReadData(dbPath, "MyTable")

lstDisplay.Items.Clear()

Do While Not rsDbase.EOF

THE 3 LINES BELOW IS THE PROBLEM, Extract the date, time and name from the recordset
sDate = rsDbase("Date")
sTime = rsDbase("Time")
sName = rsDbase("Name")

lstDisplay.Items.Add(sDate & " " & sTime & " " & sName)

rsDbase.MoveNext()
Loop

End Sub
 
Back
Top