Re: Bind ADODB Recordset to SSDBGrid in vb6




"Hetal" <hetal.a.kapadia@xxxxxxxxx> wrote in message
news:32d18b36-cddf-4611-8b6c-e71047ebc535@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Apr 8, 10:08 am, "Richard Mueller [MVP]" <rlmueller-
nos...@xxxxxxxxxxxxxxxxxxxx> wrote:
Hetal wrote:
How can i bind ADODB Recordset to SSDBGrid control in VB6?

Currently i have SSDBGrid Control named dbgTMRequest on my form with
DataMode set to "0-Bound". The recordset that i am binding it to is
rstTMRequests. Here is the code that i am using to bind my recordset
to the grid control.

======================
strSQL = "Select * from...."
rstTMRequests.Open strSQL, cntDBPOS, adOpenStatic, adLockReadOnly
dbgTMRequest.DataSource = rstTMRequests.DataSource
dbgTMRequest.Rebind
dbgTMRequest.Refresh
======================

When i do this my grid shows up as blank even when there are records
in the recordset. Am i missing to do something here?

I would try:

Set dbgTMRequest.DataSource = rstTMRequests

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab -http://www.rlmueller.net
--

I tried doing this and it still shows the blank grid. Is is possible
that i am missing to tweak a setting for ssdbgrid control (except
DataMode property) to make this work?

I remember I had something similar with another grid (or was it the one you
are asking about?). That time the problem was that the control worked
properly with ClientSide cursor only. Try to set cursor side to the Client
explicitly before rst opening.

Dmitriy.


.



Relevant Pages

  • Re: Bind ADODB Recordset to SSDBGrid in vb6
    ... DataMode set to "0-Bound". ... Here is the code that i am using to bind my recordset ... Am i missing to do something here? ... Set dbgTMRequest.DataSource = rstTMRequests ...
    (microsoft.public.vb.database.ado)
  • Re: Bind ADODB Recordset to SSDBGrid in vb6
    ... DataMode set to "0-Bound". ... Here is the code that i am using to bind my recordset ... to the grid control. ... Set dbgTMRequest.DataSource = rstTMRequests ...
    (microsoft.public.vb.database.ado)
  • Re: Simple Insert Into...
    ... The form is based on an SQL in the form's Record Source property, ... holds the current text in the control, ... Sometimes the unbound controls do have a value (such as when they are set ... I need this value to assign a unique ID to the entire recordset being ...
    (microsoft.public.access.modulesdaovba)
  • Re: Select query with parameters
    ... I can use data grid control if it will be better for my situtaion. ... When you Open a recordset you pass an SQL query statement as a string. ...
    (microsoft.public.vb.database.ado)
  • Re: Me! vs Me. (was temporarily Re: !fidlname vs .controlname)
    ... .controlname is to refer to a control (and if it is not on the form, then the recordset will be searched) ... change the NAME of another control on your form --> Test whose ControlSource is something else and is filled out ... In this case, however, the bang and the dot can be interchanged. ...
    (microsoft.public.access.formscoding)

Loading