Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2001
    Posts
    24

    Unanswered: Problem with VB code after conversion Access 97 to Access 2003

    Hello,

    I have a problem with my VB 6 code after converting my Access 97 to Access 2003.
    Before this conversion everything was working well. This was my code:

    Code:
        Set oCn = New ADODB.Connection
        Set oRs = New ADODB.Recordset
        Set ClosureRs = New ADODB.Recordset
    
        sConnect = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=\\AP721\disk_d\MIS_Portal\Functions\portal.mdb"
        oCn.Open sConnect
        oRs.Open "select caption_fr from clotures order by id desc", oCn, adOpenKeyset, adLockOptimistic
    
    
        oRs.MoveFirst
        cboClosureDatesIntra.Text = oRs("Caption_fr")
        Do Until oRs.EOF
            cboClosureDatesIntra.AddItem oRs("Caption_fr")
            oRs.MoveNext
        Loop
        oRs.Close
        
        ClosureRs.Open "select Statistics.Caption_FR, Statistics.Caption_NL, Statistics.Last_Update FROM Clotures INNER JOIN Statistics ON Clotures.ID = Statistics.Cloture_Id WHERE Clotures.Caption_FR='" & cboClosureDatesIntra.Text & "' order by statistics.caption_fr", oCn, adOpenKeyset, adLockOptimistic
        Set grdDataGridIntra.DataSource = ClosureRs
    This was working well with my Access 97 database. It gave some results.

    After I did the conversion I changed the provider to
    Code:
    Microsoft.Jet.OLEDB.4.0
    and then I get an empty grid...
    What is wrong here?

    Thx!
    Last edited by loquin; 11-30-06 at 14:29.

  2. #2
    Join Date
    Dec 2001
    Posts
    24
    I forgot to tell you my machine changed from Windows NT to Windows XP.

    Meanwhile I found the solution for my problem!
    I had to add an extra line of code before opening the ClosureRs recordset. this is the line I'm talking about: ClosureRs.CursorLocation = adUseClient

    Can someone explain me why this is needed to resolve my problem?

    Thx.

Posting Permissions

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