If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Help! (w/DAO to read an Access database)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-22-03, 12:11
BryanBentz BryanBentz is offline
Registered User
 
Join Date: May 2003
Location: Stonington, CT
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 05-22-03, 12:13
BryanBentz BryanBentz is offline
Registered User
 
Join Date: May 2003
Location: Stonington, CT
Posts: 2
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).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On