Linking Autocad2k and Access with VBA

Discussion in 'AutoCAD' started by sent, Mar 28, 2005.

  1. sent

    sent Guest

    Hi all!
    I'm in trouble.
    I have to make a program under acad2000. That isn't a "big" problem, but i am very novice in this part of the programing. My problems are the following:
    I have a database in Access with forms, tables, i have also blocks in AutoCAD. My job is linking the object in acad and the blocks in a access database.
    How can i do the following with the help of vba:
    I want see a list in acad2000, this list will be the one of the access databases table (example apple, pear, orange), and if i choose one item from the list that calls a block from what i made before it and insert it at the modelspace some x,y,z co-ordinates.
    If somebody has it in a program and can send it that would be great and helpfull.

    Pls help:)
    Many thanks.
     
    sent, Mar 28, 2005
    #1
  2. You will find many topics on this in the Customization Group. Also
    there is a sample in the help menu. Think it was there in 2000.
     
    Paul Richardson, Mar 28, 2005
    #2
  3. Sorry..."Connectivity Group"
     
    Paul Richardson, Mar 28, 2005
    #3
  4. You will need to use one of the Microsoft data access libraries, either Data
    Access Objects (DAO) or ActiveX Data Objects (ADO) from an AutoCAD VBA code
    module to access the MS-Access table your information is stored in. As Paul
    mentioned, AutoCAD comes with a sample showing how to do this. Take a look
    in the Program Files\ACAD2000\SAMPLE\ forder for "db_samp.dwg" and
    "db_samples.mdb". DAO and ADO help should be available from the main Access
    help, probably under the "Programming Information" book. See if they make
    any sense to you, then ask some more questions.
    --
    John Goodfellow
    irtfnm (presently available for projects)
    use john at goodfellowassoc dot com


    am very novice in this part of the programing. My problems are the
    following:
    AutoCAD. My job is linking the object in acad and the blocks in a access
    database.
    databases table (example apple, pear, orange), and if i choose one item from
    the list that calls a block from what i made before it and insert it at the
    modelspace some x,y,z co-ordinates.
     
    John Goodfellow, Mar 28, 2005
    #4
  5. sent

    sent Guest

    Thx for the help.
    I will do that.
     
    sent, Apr 2, 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.