Results 1 to 12 of 12

Thread: ADODC Connection

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    22

    ADODC Connection

    I tried putting two ADODC controls on my form, which both connect to the same database. One connects to one table in the database, while the other connects to a different table. For some reason, only ADODC1 is working. When I run the program, ADODC2 is disable and will not work. Does anyone know what is causing this problem? Thanks.

    -B4

  2. #2
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Make sure it's not opening the database exclsuively.
    And look at how it's connecting to the db any recordset locks?

    A better solution would not to use the datacontrol at all but just use adodb!

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    22
    The ADODC control does not have an Exclusive property, and I am not familiar with ADODB, could you provide me with any more information you have? Thanks in advance.

  4. #4
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Ok you can use karls tutorial on vb-world for adodb to learn or use my images in databases that uses it too.

    But in adodc, this is off the top of my head, there should be something like adolockpessimistic, or adolockoptimistic in where you specify you connection!
    Or look at things like move forward only.

    Gimme 20 mins i'll have a look for you!

    b

  5. #5
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Ok:

    Check stuff like:

    Mode Property: Should be ShareDenyNone
    Lock Type: Should be Optimistic

    In Custom/Build and the advanced tab should have sharedenynone

    Hows that?

    b

  6. #6

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    22
    What is the best method to use? I am trying to connect to an Access database, and then link the textboxes in my form to the fields from the database. I am not sure how to do with without using ADODC.

  8. #8
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    first you need to learn a little bit about ADO

    you need a connection object

    then you a recordset object
    then you send in a sql statement to retrieve the data

    pretty simple
    i could give you the code
    but you should learn it
    start with learning what ADO is and how to use it

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    22
    I would be interested in learning more about ADO. Could you please point me to some places which provide good tutorials or information so that I can get a better understanding? Thanks.

  10. #10

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    22
    Thank you very much.

  12. #12
    Addicted Member
    Join Date
    Sep 2001
    Location
    Florida
    Posts
    213
    You can set the properties of those 2 ADODC at design or you can code them at Form_Load.

    I have 2 ADODC in my App and I use the following code and have no problem with that.

    Private Sub Form_Load()

    With Adodc1
    .ConnectionString = _
    "Provider=Microsoft.Jet.OLEDB.3.51;" & _
    "Persist Security Info=False;Data Source=" & _
    App.Path & "\db1.mdb;Mode=ReadWrite"
    .CommandType = adCmdTable
    'set Table name
    .RecordSource = "Table1"
    .Refresh
    End With

    With Adodc1
    .ConnectionString = _
    "Provider=Microsoft.Jet.OLEDB.3.51;" & _
    "Persist Security Info=False;Data Source=" & _
    App.Path & "\db1.mdb;Mode=ReadWrite"
    .CommandType = adCmdTable
    'set Table name
    .RecordSource = "Table2"
    .Refresh
    End With


    End Sub

    Replace 3.51 by 4.0 if you are using MS Access 2000

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