Results 1 to 12 of 12
  1. #1
    clebergyn is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Location
    Brazil
    Posts
    48

    ADO connection, how do?


    Hello, friends, I have a form with a subform, I am new to ADO, made a Via ADO connection in form and subformularo with fields "master" and "child" after connect you can not register / change data, nor work ties "LinkMasterFields" and "LinkChildFields" the subform, does not filter. What to do?
    the code I use is this:


    MyDatabase = "\\RECEPCAO\Sistema\Tabelas-sistema.accdb "
    Dim mOrigem
    mOrigem = "Select * from [tab medico] where [codigo] like " & Forms![medico entrada]![Medico]
    cn1.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & MyDatabase
    rs1.CursorLocation = adUseClient
    rs1.Open mOrigem, cn1, adOpenDynamic, adLockOptimistic
    Set Forms("medico atendimento").Recordset = rs1
    rs1.Close
    cn1.Close
    Set rs1 = Nothing
    Set cn1 = Nothing

    want to make the ADO connection and use the formuário and subform similar to DAO, no way?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Why are you using VBA to set connection? What is the backend db? Why not set up linked tables? I've never set a RecordSource with a recordset object. Review http://stackoverflow.com/questions/6...as-a-recordset which indicates cannot be done. Does it work with DAO?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    clebergyn is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Location
    Brazil
    Posts
    48
    my bd is already divided into back-end and front-end. I want to ADO connection, to improve the simultaneous accesses and improve performance. With back-end and front-end I will have how many simultaneous access?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I don't routinely use VBA to set connection to backend. I use table links. Not sure what you mean by 'simultaneous accesses'.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    linkchild and linkmaster only works with dao recordsets

    So your subform recordset needs to have the criteria to limit the recordset to what you want

    filtering is also different with ADO

    you cannot filter on LIKE '*abc*', only LIKE 'abc*'
    you assign the filter to the recordset rather than the form (me.recordset.filter=....) rather than me.filter=...
    and you need to reassign the recordset (set me.recordset=me.recordset) to activate the filter rather than using filteron=true

    other things you cannot do with ADO is join tables from different databases

  6. #6
    clebergyn is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Location
    Brazil
    Posts
    48
    on "simultaneous access" I meant "multiplayer". several users access the db at the same time. I do not know how to speak English

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I have multiple users and I use linked tables. Each user has their own copy of frontend installed on their local C drive. I also use UNC pathing for the table links.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    clebergyn is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Location
    Brazil
    Posts
    48
    What is UNC "path is in the table links"? what is it for? improves performance, and improves for a bd multiple users?

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    UNC - Universal Naming Convention. Instead of mapped drive path in table links, such as R:\path\backend.accdb, uses server name in the path: \\servername\path\backend.accdb

    This means users are not required to have a specific drive mapping for the frontend to link to backend.

    I use VBA code to set this UNC link.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    clebergyn is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Location
    Brazil
    Posts
    48
    I made the links of the network tables, network patch. Well, then tell me. I have a database (Access-using DAO) with tables that are linked by the network, how many hits multiple users I'll be able to have on my system? here in Brazil some speak 10 multiple-users and others say it's more. Do you know?

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    clebergyn is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Location
    Brazil
    Posts
    48
    well, like talking about SQL Server. But then you know to SQL server, I using the tables by the server, I'll have to change the codes of my front-and program (Access)? I will be able to use the view query, use the forms linked tables? use bd Access with DAO?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Connection and QueryDefs
    By dccjr in forum Programming
    Replies: 11
    Last Post: 01-15-2013, 09:14 PM
  2. ODBC Connection
    By abhijeet@wipro in forum Access
    Replies: 3
    Last Post: 01-11-2013, 06:42 AM
  3. DAO Connection
    By Tyork in forum Programming
    Replies: 1
    Last Post: 10-11-2010, 01:35 PM
  4. Connection to same DB
    By emilylu3 in forum Access
    Replies: 1
    Last Post: 12-30-2005, 09:59 AM
  5. connection to db
    By emilylu3 in forum Access
    Replies: 2
    Last Post: 12-29-2005, 01:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums