-
November 12th, 2001, 07:36 AM
#1
a quest about datagrid
i have a recordset object and has been open already. if i want to show the data in a mshflexgrid, i can use a line of code like this:
set mshflexgrid1.recordset=recordset1
the question is, what should i do if i want to use a datagrid to show the data of the recordset?
i use set datagrid1.datasource=recordset1,but no use.
will somebody tell me ? thanks in advance
-
November 12th, 2001, 08:05 AM
#2
Re: a quest about datagrid
datagrid. datasource is a database. To put rs to dbgrid, use
datagrid.recordsource=rs
Iouri Boutchkine
iouri@hotsheet.com
-
November 12th, 2001, 08:39 AM
#3
Re: a quest about datagrid
thanks first of all.
but I use datagrid ,not dbgrid,
this of datagrid?
-
November 12th, 2001, 08:50 AM
#4
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
-
November 12th, 2001, 09:07 AM
#5
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
-
November 12th, 2001, 11:14 AM
#6
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
-
November 12th, 2001, 07:31 PM
#7
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
-
November 23rd, 2001, 10:16 AM
#8
Re: a quest about datagrid
Please add in the following statement:
rs.CursorLocation = adUseClient
then only follow by:
rs.open c
Hope it helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|