1 Attachment(s)
DataGrid cannot show all entries from Access!!
Hello people! First I want to say thanks for all your help on previous threads of mine that has been resolved... Thank you very much, this is a great forum with great people..
My problem here is that I've got a program working with ADODB and Access (mdb file) with DataGrid... Now when I run the app it doesn't shows all entries from the table! I don't know why! Even when it shows a scrollbar there i can't use it...
Attachment 128487
:ehh::ehh::ehh:
From now, thank you for having read this thread...
best regards,
Re: DataGrid cannot show all entries from Access!!
You would have to show some code. A picture tells us nothing about what is going on in the code. How many records are you expecting? What query are you using, how are you getting the data into the grid? What other code do you have if any that may be causing a problem with the grid?
Re: DataGrid cannot show all entries from Access!!
Quote:
Originally Posted by
DataMiser
You would have to show some code. A picture tells us nothing about what is going on in the code. How many records are you expecting? What query are you using, how are you getting the data into the grid? What other code do you have if any that may be causing a problem with the grid?
Code:
Dim conexion As New ADODB.Connection
Dim registros As New ADODB.Recordset
Private Sub Form_Load()
Set DataGrid1.DataSource = registros
If conexion.State <> 1 And registros.State <> 1 Then
conexion.CursorLocation = adUseClient
conexion.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data source=" & App.Path & "\dbInventario.mdb"
registros.CursorLocation = adUseClient
registros.Open "SELECT * FROM Prestaciones ORDER BY IdPrestamo ASC", conexion, adOpenDynamic, adLockOptimistic
Set DataGrid1.DataSource = registros
End If
End Sub
Private Sub cmdUltimo_Click()
On Error GoTo error
registros.MoveLast
Busqueda.MoveLast
error:
Label1.Caption = "Ultimo"
Exit Sub
End Sub
Private Sub cmdPrimer_Click()
On Error GoTo error
registros.MoveFirst
Busqueda.MoveFirst
error:
Label1.Caption = "Primero"
Exit Sub
End Sub
Private Sub cmdSiguiente_Click()
On Error GoTo error
registros.MoveNext
Busqueda.MoveNext
error:
Label1.Caption = "Seleccionado"
Exit Sub
End Sub
Private Sub cmdAnterior_Click()
On Error GoTo error
registros.MovePrevious
Busqueda.MovePrevious
error:
Label1.Caption = "Seleccionado"
Exit Sub
End Sub
That's the specific code for the datagrid
Re: DataGrid cannot show all entries from Access!!
I mean, it actually show all of them, but I can't see them because the SCROLL BAR doesn't moves down....
Re: DataGrid cannot show all entries from Access!!
Almost looks like the datagrid doesn't know how many records are in the grid? Does the grid have a refresh method? If so, try that after you assign the recordset. Just a thought & easy enough to test