Re: a quest about datagrid
datagrid. datasource is a database. To put rs to dbgrid, use
datagrid.recordsource=rs
Iouri Boutchkine
[email protected]
Re: a quest about datagrid
thanks first of all.
but I use datagrid ,not dbgrid,
this of datagrid?
Re: a quest about datagrid
"Set datagrid.datasource=record1" is what u need to display the data. Check if the recordset is still open.
Thanks
Re: a quest about datagrid
i 'm sure the recordset is open,
is there any properties need to be set before show
data in datagrid? thanks
Re: a quest about datagrid
as i said the only line of code u need to display the data is setting the data source property of the data grid. You can set other properties like if u wanna allow upadet, addnew ets operations using the grids. Right click on the grid then select properties.
Thanks
Re: a quest about datagrid
but it sames to be no use. will you please see my code? like this:
________________________________________
Dim C As New ADODB.Command
Dim rs As New ADODB.Recordset
On Error Resume Next
C.ActiveConnection = afxAdoConnection
C.CommandText = "select * from tblFiles"
C.CommandType = adCmdText
afxAdoConnection.Errors.Clear
rs.Open C
If afxAdoConnection.Errors.Count > 0 Then
Write_Error
Else
Set gridFiles.datasource = rs
End If
___________________________________
gridFiles is the name of the datagrid
Re: a quest about datagrid
Please add in the following statement:
rs.CursorLocation = adUseClient
then only follow by:
rs.open c
Hope it helps.