CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    27

    The rowset is not bookmarkable

    Hi...

    I tried to connect to a mySQL database using adodc and displayed the result set using datagrid and it worked.

    But this one doesn't. Can anyone please explain to me why the result set isn't bookmarkable? Thanks..

    Here's my source code.

    Dim conn As New ADODB.Connection
    Dim rs As New ADODB.Recordset

    conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=pos;UID=root;PWD=;"
    conn.Open

    rs.open "select * from users", conn

    set datagrid1.datasource = rs

  2. #2
    Join Date
    Feb 2006
    Location
    Athens, Greece
    Posts
    111

    Resolved Re: The rowset is not bookmarkable

    Code:
        On Error GoTo ErrorHandler
        
        Dim strSQL As String
        Dim lngTmpCustID As Long
        
        lngTmpCustID = CLng(frmMain.txtcust_id.Text)
        
        strSQL = "SELECT   Customers.cust_id,Customers.field1, Calls.operator, Calls.call_date, Calls.call_time, " _
            & " Calls.call_result FROM  Customers INNER JOIN Calls ON Customers.cust_id = " _
            & " Calls.cust_id AND Customers.batch_id = Calls.batch_id " _
            & " WHERE Customers.batch_id=" & intContactedBatchId & " AND " _
            & " Customers.cust_id=" & lngTmpCustID & ""
        
        With rsDenMilise
            .CursorLocation = adUseClient
            Call .Open(strSQL, CSTR_CONNECTION, adOpenDynamic, adLockOptimistic)
            Set dgDenMilisa.DataSource = rsDenMilise
            
            dgDenMilisa.Columns(0).Caption = "Test0"
            dgDenMilisa.Columns(1).Caption = "Test1"
            dgDenMilisa.Columns(2).Caption = "Test2"
            dgDenMilisa.Columns(3).Caption = "Test3"
            dgDenMilisa.Columns(4).Caption = "Test4"
            dgDenMilisa.Columns(5).Caption = "Test5"
            
        End With
    
    ErrorHandler:
        If Err <> 0 Then
            Call LogError(Err, "frmSpecificDetails.SetDataToGridDenMilise")
        Else
            Exit Sub
        End If
    End Sub
    the bold code is your error!

    try it.

    Regards

    VPlag
    Good Luck
    -------------------*-------------------*------------------------
    Today we will see how we can develop:

    Ingredients:

    Espresso, cigarettes and lounge music
    -----------------------------------------------------------------
    Please remember to rate the posts and threads that you find useful

  3. #3
    Join Date
    Apr 2004
    Posts
    27

    Re: The rowset is not bookmarkable

    Thanks!

    This is what I get for not programming in VB for 8 months hehe.

  4. #4
    Join Date
    Feb 2006
    Location
    Athens, Greece
    Posts
    111

    Re: The rowset is not bookmarkable

    happy that it helped u

    Regards

    VPlag
    Good Luck
    -------------------*-------------------*------------------------
    Today we will see how we can develop:

    Ingredients:

    Espresso, cigarettes and lounge music
    -----------------------------------------------------------------
    Please remember to rate the posts and threads that you find useful

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured