Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Stonington, CT

    Unanswered: Help! (w/DAO to read an Access database)

    I have code working in my development environment, but when I build an installation kit and try it on other machines, the code fails. I've been pulling my hair out over this for a few days.

    I'm using MS Visual Basic 5, with DAO (DAO360.dll) to read a database
    created with MS Access 2000. It all works fine (meaning I can open the database, read the tables, etc.), until I try to set a parameter for a query - then I get "Automation Error" -2147417848 (80010108), and the application exits.

    Here is the relevant code fragment:
    Dim Db As Database
    Dim Qd As dao.QueryDef 'Trying the DAO prefix makes no difference
    Dim Rs As Recordset
    Dim Ws As Object
    Dim InWord As String
    Dim Path As String
    Dim Result As String
    Dim QueryName As String

    Path = VerbsFile
    InWord = SpanishInVal 'argument passed in as a string
    QueryName = "UnAccentedSpanishWordQuery"

    Set Db = OpenDatabase(Path, ReadOnly:=True)

    MsgBox ("About to open query: " & QueryName)
    Set Qd = Db.QueryDefs(QueryName)

    MsgBox ("About to set parameter to """ & EngWord & """")
    Qd.Parameters("[Spanish Word]") = EngWord

    (and execution ends here; the next statement is a msgbox).

    My dev. env. is a Windows 2000 machine; the targets vary, but I'm testing particularly aggressively on a Windows 98 machine. I build the installation kit using the newest version of InstallShield, which has worked just fine in the past. It is possible that I've got a situation with .dll versions on the source/destination machine, but if so I'm surprised that things work as well as they do.

    Bryan Bentz

  2. #2
    Join Date
    May 2003
    Stonington, CT

    Re: Help! (w/DAO to read an Access database)

    The InWord/EngWord discrepancy in my post is an artifact of me editing it down for inclusion; in the real code there is no such bug. (I just noticed this on reviewing my post).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts