Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Posts
    10

    Unanswered: Connection Cursor Location in MS Access

    I have a open a connection as

    Code:
    Dim Repdatabase as String
    Dim Con as adodb.connection
    
    ‘@ Start Open a Connection
    Set con = New ADODB.Connection
        With con
            .CursorLocation = adUseServer
            .ConnectionTimeout = 30
            .Provider = "Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;"
            .ConnectionString = App.Path & "\MyDb.mdb"
            .Open
        End With
    
        RepDatabase = App.Path & "\Reports.mdb"
    ‘@ End of Connection
    When I m executing following query in connection it work perfectly fine irrespective of cursorLocation is aduseServer or aduseClient.

    Code:
    '@ It insert data in report Database
    
    con.Execute "insert into VirtualDB(Name) in '" & RepDatabase & "' values('" & CStr(k) & "')"

    When I am executing following query in record set to insert data in report database when the cursor Location is aduseServer in Connection String

    Code:
    Rs.open “select * from tb_BillDetailsTandT in '" & RepDatabase & "'", con, adOpenStatic, adLockPessimistic
    Rs.addNew
    
    ‘@ Code to insert Data in table
    
    Rs.update
    It works perfectly Fine. It insert data in report database.


    But when I change CursorLocation to aduseClient, bcoz of Access does not support CusrorLocation aduseServer the above codes insert data in Mydb.mdb instead of Reports.mdb.

    How it can be Poosible Plz Help me.
    Last edited by loquin; 10-06-06 at 12:35. Reason: add [code] [/code] tags for readability.

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Access does not support server-side cursor location, and ADO quietly ignores anything else. Even though you might specify adUseServer, ado won't do it.

    However, in the past, I HAVE noticed some odd behavior in the past if I try to explicitly define server-side cursors in an access datafile. I would classify a recordset bound to one database updating a table in another database (as you say it was doing) to be a bug.

    I would simply open two connections, one to each database, or close Con, and re-connect to the appropriate datafile as needed.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  3. #3
    Join Date
    Sep 2006
    Posts
    10
    Quote Originally Posted by loquin
    Access does not support server-side cursor location, and ADO quietly ignores anything else. Even though you might specify adUseServer, ado won't do it.

    However, in the past, I HAVE noticed some odd behavior in the past if I try to explicitly define server-side cursors in an access datafile. I would classify a recordset bound to one database updating a table in another database (as you say it was doing) to be a bug.

    I would simply open two connections, one to each database, or close Con, and re-connect to the appropriate datafile as needed.

    thanks for ur reply

Posting Permissions

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