Database problem

Discussion in 'AutoCAD' started by peltsu, Jan 7, 2005.

  1. peltsu

    peltsu Guest

    Hi,
    how do I disconnect from a Access database using ADODC ?
    I've created a front end to populate a database table with attributes from a drawing and view or even edit them on a form. This works fine, but if I change some of the attributes in a drawing I have to update the database table. It only works if I close my program. Autocad will not overwrite the existing table, even if I give it a permission. I suppose disconnecting from a database will do the trick - but how is that accomplished ?

    Yours
    Seppo Peltomaa
     
    peltsu, Jan 7, 2005
    #1
  2. The problem might be in your recordset.
    Make sure that is updateable

    Myrecordset.LockType = adLockOptimistic

    before you open it.
     
    Jorge Jimenez, Jan 7, 2005
    #2
  3. peltsu

    peltsu Guest

    Thanks Jorge,
    I tried it, but in vain. The problem might be that the DataGrid where the records go does not "accept" a recordset as a datasource from code. In properties window it will take adodc1 control. So I suppose that the connection is on if I can not change that value or disconnect adodc1. It seems that I do not have enough knowledge to do this kind of things, but I try :)

    yours
    Seppo Peltomaa
     
    peltsu, Jan 8, 2005
    #3
  4. ....
    myrecordset.open sqlstring
    Set DataGrid1.Datasource = myrecordset
    ....
     
    Jorge Jimenez, Jan 9, 2005
    #4
  5. peltsu

    peltsu Guest

    Thanks Jorge,
    I got it. It works now.

    Yours
    Seppo Peltomaa
     
    peltsu, Jan 10, 2005
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.