How to add record to Access table through visual lisp activex (I need the VB ! operator)

Discussion in 'AutoCAD' started by Ivan Starr, Aug 25, 2003.

  1. Ivan Starr

    Ivan Starr Guest

    Hello and thanks for trying to help.

    I'm trying to add a record to an Access Database.

    The problem is that I don't know how to create an autolist equivalent of the
    ! VB operator.

    here is my code:
    (setq LOCATION "D:\\Clients\\Joseph R. Loring & Associates\\Enumerate")
    (setq TELECOMDB (strcat LOCATION "\\TelecomDB.mdb"))
    (setq *AccessApp* (vlax-get-or-create-object "Access.Application"))
    (vla-put-visible *AccessApp* 1)
    (vlax-invoke-method *AccessApp* 'OpenCurrentDatabase TELECOMDB :vlax-false)
    (setq TelecomDBobj (vlax-invoke-method *AccessApp* 'CurrentDb))
    (setq RegionsTable (vlax-invoke-method TelecomDBobj 'OpenRecordSet
    "Regions"))
    (vlax-invoke-method RegionsTable 'AddNew)
    ....????

    I don't know what method or property fo the RegionsTable object to call to
    fill the new recordset with data, done in VB with the operator !, as in
    RegionsTable![fieldname].

    I need a function to do that, then run the Update method.

    anyone know how to do this or a code snippet that adds a record to an acces
    db table?

    Thanks,

    Ivan
     
    Ivan Starr, Aug 25, 2003
    #1
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.