Any ADO/CAO experts out there?

Discussion in 'AutoCAD' started by stumped again, Jun 16, 2004.

  1. I'm trying to migrate an AutoCAD 2002 project to 2004/2005. I'm connecting to an Access database using the Microsoft Jet 4.0 OLE DB Provider.

    The portion of the code I'm having problems with checks for an existing link template and creates it if it doesn't already exist.


    Set LinkT = dbc.GetLinkTemplates(ThisDrawing).Item(strTemplateName)
    If Err <> 0 Then
    Set LinkT = dbc.GetLinkTemplates.Add("Datasource", , , "Table", "LinkTemplateName", KeysDesc)
    End If


    Here's the problem. According to the AutoCAD 2004 help, "Optional parameters: Mandatory parameters no longer follow optional parameters, so some parameters that formerly were optional have become mandatory."


    The Catalog and Schema parameters are no longer optional. It's my understanding that Access doesn't support Schemas. I've tried using bogus values for the schema parameter including a zero-length string. Is it possible to get this to work with Access and ACAD2004? Any other workarounds to create link and label templates through VBA?

    Thanks,

    Stumped Again
     
    stumped again, Jun 16, 2004
    #1
  2. Never Mind! It seems plugging in a zero-length string for the Catalog and Schema values will work! At least it will if you change EVERY GetInterfaceObject method to a version-dependent ProgID.

    No Longer Stumped!
     
    stumped again, Jun 16, 2004
    #2
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.