Hi to all.
Here are the facts:
I have 3 variables declared as Global Objects in a module:
OraSession
OraDatabase
OraRecordset
Here is the code:
Private Sub LoadGrid()
Dim sSQL As String
Dim sData As String
Set OraSession = CreateObject("OracleInProcServer.XOraSession"
Set OraDatabase = OraSession.dbOpenDatabase("Service", "user/tpassword", 0&)
sSQL = "SELECT * FROM tbldba"
Set OraRecordset = OraDatabase.CreateDynaset(sSQL, 8&)
If OraRecordset.RecordCount = 0 Then
Me.MSFlexGrid.Clear
Else
OraRecordset.MoveFirst
Me.MSFlexGrid.Rows = 1
Do Until OraRecordset.EOF = True
sData = "" & Chr$(9)
sData = sData & OraRecordset.Fields(0) & Chr$(9)
sData = sData & OraRecordset.Fields(1) & Chr$(9)
sData = sData & OraRecordset.Fields(2) & Chr$(9)
sData = sData & OraRecordset.Fields(3) & Chr$(9)
Me.MSFlexGrid.AddItem sData
OraRecordset.MoveNext
Loop
End If
End Sub
Now the problem:
The connection works fine. But the grid displays only the last entry made in the table tbldba. The problem is the MoveFirst event, because the RecordCount works fine.
Is this a bug? Or do I have to write more code in order to see all my entries in the grid?
Any help will be appreciated.
Thanks ''Life is like a box of chocolate...''
Here are the facts:
I have 3 variables declared as Global Objects in a module:
OraSession
OraDatabase
OraRecordset
Here is the code:
Private Sub LoadGrid()
Dim sSQL As String
Dim sData As String
Set OraSession = CreateObject("OracleInProcServer.XOraSession"
Set OraDatabase = OraSession.dbOpenDatabase("Service", "user/tpassword", 0&)
sSQL = "SELECT * FROM tbldba"
Set OraRecordset = OraDatabase.CreateDynaset(sSQL, 8&)
If OraRecordset.RecordCount = 0 Then
Me.MSFlexGrid.Clear
Else
OraRecordset.MoveFirst
Me.MSFlexGrid.Rows = 1
Do Until OraRecordset.EOF = True
sData = "" & Chr$(9)
sData = sData & OraRecordset.Fields(0) & Chr$(9)
sData = sData & OraRecordset.Fields(1) & Chr$(9)
sData = sData & OraRecordset.Fields(2) & Chr$(9)
sData = sData & OraRecordset.Fields(3) & Chr$(9)
Me.MSFlexGrid.AddItem sData
OraRecordset.MoveNext
Loop
End If
End Sub
Now the problem:
The connection works fine. But the grid displays only the last entry made in the table tbldba. The problem is the MoveFirst event, because the RecordCount works fine.
Is this a bug? Or do I have to write more code in order to see all my entries in the grid?
Any help will be appreciated.
Thanks ''Life is like a box of chocolate...''