Problem with Data Grid in VB 6 (Error 7005: Rowset not available)

Discussion in 'Programming' started by a.ambily, Jan 6, 2009.

  1. #1
    Hi,
    :( :confused:

    I am working with a datagrid control.
    I want to fetch the record onto the datagrid
    but whenever i try to do , it gives an eror message
    "Rowset Not Available"
    Need help Urgent.


    Code is Below

    Set rstObligDetail = New Recordset
    rstObligDetail.CursorLocation = adUseClient
    rstObligDetail.ActiveConnection = cnITS
    rstObligDetail.CursorLocation = adUseClient
    rstObligDetail.CursorType = adOpenStatic
    rstObligDetail.LockType = adLockReadOnly

    rstObligDetail.Open "Select Description, Agreement_Year, Equivalent_Quantity, Unit_Conversion_Factor, Obligation_ID from Agreement_Obligation_Detail where Agreement_ID=" & txtAgreementNo & " order by Description"

    If rstObligDetail.RecordCount = 0 Then
    frmAgreement.chkOblig.Value = 0
    Else
    Set dbdObligation.DataSource = rstObligDetail
    End If

    Private Sub dbdObligation_RowColChange(LastRow As Variant, ByVal LastCol As Integer)

    Dim varbookmark As Variant
    varbookmark = dbdObligation.Bookmark
    If IsNull(varbookmark) Then
    Exit Sub
    End If

    If Not dbdObligation.DataSource Is Nothing Then
    dbdObligation.Bookmark = varbookmark

    txtObligID.Text = CheckForNull(dbdObligation.Columns(4).CellValue(dbdObligation.Bookmark))
    txtObligYear = CheckForNull(dbdObligation.Columns(1).CellValue(dbdObligation.Bookmark))
    medQty.Mask = ""
    medQty.Text = ""
    medQty.Text = CheckForNull(dbdObligation.Columns(2).CellValue(dbdObligation.Bookmark))
    txtUnitFactor = CheckForNull(dbdObligation.Columns(3).CellValue(dbdObligation.Bookmark))

    Else
    Exit Sub
    End If

    End Sub

    THANKS IN ADVANCE

    Ambily
     
    a.ambily, Jan 6, 2009 IP
  2. a.ambily

    a.ambily Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Please Please I need Solution Urgently.. No one know the answer????

     
    a.ambily, Jan 12, 2009 IP