VMware Horizon Community
therefreshments
Contributor
Contributor

Having issues Thinapp'ing an Access2010 database with ODBC connections

We have a home grown program that uses Access2010 to pull data into a database to run reports off of.  There is an .msi installer for this "reports" program that creates a shortcut on the desktop, it brings down the latest version of the Access database(usually 82MB) and puts it under a folder on %program Files%, and it also creates 2 ODBC connections to servers.   I'm building it on an XP SP3 VM using VMware Workstation, and Thinapp 4.7.3. I installed just Access prior to running the prescan. I also have to join the VM to our domain, because it goes out to a server location for files...

After I build the program and test it on a Win7 32 bit VM, i run into usually two errors.  One of the errors is once it starts opening Access I get the error "Microsoft Visual Basic for Applications" File not found: VBA6.DLL. Other times I get the error  that it cannot find the file or location of the database and it's looking for the database in the %program files% folder it installed to in the first place.  But because of the sandbox thingy the database obviously is not there. It's under %Appdata% 

I've tried downloading a copy of the VBA6.DLL and registering it, but it says it's am invalid .dll. I have it running successfully on 1 Win7 VM right now, but can't figure out why it works on that, and not a fairly identical VM. The one it's working on, Office2010 is Thinapp'd. So I installed the ThinApp'd Office to the other VM and it gave me the file not found error. Where before I was getting the VB error. So I manually copied the database from a PC, and it get's in ok, but when I run something it gives me ODBC errors. 

What am I doing wrong, or what should I be doing?  I don't change anything in the Package.ini besides the MSI Manufacturer. Is this even possible to ThinApp?  My co-workers will take me out to lunch if I get this working properly since it's kind of a headache to our customers, it breaks randomly.  Also, I only select 1 entry point even though several are created.  Help!

0 Kudos
10 Replies
oliAH
Enthusiast
Enthusiast

One of the errors is once it starts opening Access I get the error  "Microsoft Visual Basic for Applications" File not found: VBA6.DLL.

Add this dll to the %SystemSystem% folder of your project and recompile by executing the build.bat.

Other times I get the error  that it cannot find the file or location of  the database and it's looking for the database in the %program files%  folder it installed to in the first place.  But because of the sandbox  thingy the database obviously is not there. It's under %Appdata%

I don't really get it. Is this happening when you're opening a MS Access database file? Why would it go looking into the %APPDATA% folder?

From your statements, it's like there are some visual basic components that are missing on your system. One thing you could try is capturing the app on the vanilla Windows XP (without any service pack). Do not forget to open those databases during the capture to make sure everything is working, even some components may be installed during this process.

Blog: http://oliah.net >> Twitter: @olivier_ahson
0 Kudos
therefreshments
Contributor
Contributor

I'll try putting the VBA6.DLL in the folder and then re-building it.  But the reason it's looking for the DB in %Appdata% is because that's where the default location of the sandbox is. Should I be doing something different in this instance where the install brings down the database file locally to C:\Program Files\Program\Reports\database.mdb and that's where the desktop shortcut is pointing to? But when you capture and build it, it doesnt create that folder structure. I'm fairly new to this, so thank you for your patience. I've only successfully done Office2010, Silverlight, IE9, and Adobe Reader XI. So just fairly simple ones, nothing like this.

I do open the database and run it after the install and it works fine. I'll even delete the program on the build VM and then run the thinapp version and it throws that VBA error. Just doesnt make sense.

0 Kudos
therefreshments
Contributor
Contributor

So after placing the VBA6.DLL in the %SystemSystem% folder, I know try and open the DB and I get an error saying "MS Office has encountered a problem and needs to close..." I click the check box to repair my open database and re-open it and I get the 2nd error as stated above. "Windows cannot find C:\Program Files\Program\Reports\Database.mdb"


Am I missing an incredibly simple step during the build process or in the Package.ini? Like where it "installs" or somethign dumb?

I'm getting the MS encountered an error on both an XP and Win7 VM FYI...

0 Kudos
oliAH
Enthusiast
Enthusiast

"Windows cannot find C:\Program Files\Program\Reports\Database.mdb"

So your msi installs this "reports" program in a folder called "Program" located in Program Files? Can you confirm this?

But when you capture and build it, it doesnt create that folder structure.

Can you confirm the folder of your "reports" program exist in the thinapp project folder? It should be in the %ProgramFilesDir% folder.

Also, can you share the lines of the entry point your talking about located in the package.ini?

Example of an entry point:

[Microsoft Office Word 2003.exe]
Source=%ProgramFilesDir%\Microsoft Office\OFFICE11\WINWORD.EXE
Shortcut=Microsoft Office Professional Edition 2003.dat
FileTypes=.doc.dochtml.dot.dothtml.rtf.wbk
ObjectTypes=Word.Application;Word.Application.11;
Shortcuts=%Programs%\Microsoft Office
Blog: http://oliah.net >> Twitter: @olivier_ahson
0 Kudos
therefreshments
Contributor
Contributor

It basically just creates the folder structure C:\Program Files\Compass\Reports\ and then copies several files there, including the main Access database. I was just using "Program" as an example.

Yes, the Reports folder exists under the project folder.  C:\Program Files\VMware\VMware ThinApp\Captures\CompassReports\%ProgramFilesDir%\Compass\Reports

For now, I've only been trying to use the 1 entry point below. I'm building it again with a seperate .DAT file.

[Compass Reports - Prod.exe]

Source=%ProgramFilesDir%\Compass\Reports\reports97.mdb
;Change ReadOnlyData to bin\Package.ro.tvr to build with old versions(4.6.0 or earlier) of tools
ReadOnlyData=Package.ro.tvr
WorkingDirectory=%Desktop%\
Icon=%AppData%\Microsoft\Installer\{CDAFCBF5-1DD4-455D-819A-28EE66D09EB5}\NewShortcut3_CDAFCBF51DD4455D819A28EE66D09EB5.exe
Comment=Compass Reports, using Production database
Shortcuts=%Desktop%
0 Kudos
oliAH
Enthusiast
Enthusiast

I do not see why your program would use the %Desktop% as the working directory. Can you try changing your WorkingDirectory parameter to the following:

WorkingDirectory=%ProgramFilesDir%\Compass\Reports
Blog: http://oliah.net >> Twitter: @olivier_ahson
therefreshments
Contributor
Contributor

Thank you for helping me with this issue. I really appreciate it.  I'm no longer getting the VB error, but even with changing the WorkingDirectory=%ProgramFilesDir%\Compass\Reports it still gives me the error "Microsoft Access can't find the database file C:\Program Files\Compass\Reports\reports97.mdb"

So I've tried using just the 1 entry point, and as well as all entry points as noted below, both result in the same error. Not sure what else to do. By the way, reports97.mdb is the database I'm wanting it to open.

[CompassReports.dat]
Source=%ProgramFilesDir%\Compass\Reports\reports97.mdb
;Change ReadOnlyData to bin\Package.ro.tvr to build with old versions(4.6.0 or earlier) of tools
ReadOnlyData=Package.ro.tvr
MetaDataContainerOnly=1
[Compass Reports - Prod.exe]
Shortcut=CompassReports.dat
Source=%ProgramFilesDir%\Compass\Reports\reports97.mdb
;Change ReadOnlyData to bin\Package.ro.tvr to build with old versions(4.6.0 or earlier) of tools
WorkingDirectory=%ProgramFilesDir%\Compass\Reports
Icon=%AppData%\Microsoft\Installer\{CDAFCBF5-1DD4-455D-819A-28EE66D09EB5}\NewShortcut3_CDAFCBF51DD4455D819A28EE66D09EB5.exe
Comment=Compass Reports, using Production database
Shortcuts=%Desktop%
[Compass Reports - Prod (1).exe]
Disabled=1
Source=%ProgramFilesDir%\Compass\Reports\reports97.mdb
Shortcut=CompassReports.dat
Icon=%AppData%\Microsoft\Installer\{CDAFCBF5-1DD4-455D-819A-28EE66D09EB5}\NewShortcut2_CDAFCBF51DD4455D819A28EE66D09EB5.exe
Comment=Compass Reports, using Production database
Shortcuts=%Programs%
[DbOptimizer.exe]
Source=%ProgramFilesDir%\Compass\Reports\DbOptimizer.exe
Shortcut=CompassReports.dat
[CompassReportsInit.exe]
Source=%ProgramFilesDir%\Compass\Reports\CompassReportsInit.exe
Shortcut=CompassReports.dat
[reports97.exe]
Source=%ProgramFilesDir%\Compass\Reports\reports97.mdb
Shortcut=CompassReports.dat
Shortcuts=%AppData%\Microsoft\Office\Recent
[ARPPRODUCTICON.exe]
Source=%AppData%\Microsoft\Installer\{CDAFCBF5-1DD4-455D-819A-28EE66D09EB5}\ARPPRODUCTICON.exe
Shortcut=CompassReports.dat
[NewShortcut2_CDAFCBF51DD4455D819A28EE66D09EB5.exe]
Source=%AppData%\Microsoft\Installer\{CDAFCBF5-1DD4-455D-819A-28EE66D09EB5}\NewShortcut2_CDAFCBF51DD4455D819A28EE66D09EB5.exe
Shortcut=CompassReports.dat
[NewShortcut3_CDAFCBF51DD4455D819A28EE66D09EB5.exe]
Source=%AppData%\Microsoft\Installer\{CDAFCBF5-1DD4-455D-819A-28EE66D09EB5}\NewShortcut3_CDAFCBF51DD4455D819A28EE66D09EB5.exe
Shortcut=CompassReports.dat
0 Kudos
oliAH
Enthusiast
Enthusiast

I'm sorry, I misunderstood your situation. I thought you were capturing your "reports" application along with MS Access. Your virtual package does not contain MS Access that's why you get a not found error message.

This is normal behavior, your native application, Microsoft Access, won't see the files inside the virtual package, here your database file. Your MS Access and your reports app must run in the same sandbox.

Blog: http://oliah.net >> Twitter: @olivier_ahson
therefreshments
Contributor
Contributor

Ah. I will give that a shot. In this case, who will be the parent where I put the Applink? Access or Compass, my application/database thingy. I'm guessing it would be Compass, but that's just a guess.

0 Kudos
oliAH
Enthusiast
Enthusiast

You may try this workaround:

[CompassReports.dat]
Source=%ProgramFilesDir%\Compass\Reports\reports97.mdb
;Change ReadOnlyData to bin\Package.ro.tvr to build with old versions(4.6.0 or earlier) of tools
ReadOnlyData=Package.ro.tvr
MetaDataContainerOnly=1
[Compass Reports - Prod.exe]
Shortcut=CompassReports.dat
CommandLine="%ProgramFilesDir%\Microsoft Office\Office14\MSACCESS.EXE" "%ProgramFilesDir%\Compass\Reports\reports97.mdb"
Source=%ProgramFilesDir%\Compass\Reports\reports97.mdb
WorkingDirectory=%ProgramFilesDir%\Compass\Reports
Icon=%AppData%\Microsoft\Installer\{CDAFCBF5-1DD4-455D-819A-28EE66D09EB5}\NewShortcut3_CDAFCBF51DD4455D819A28EE66D09EB5.exe
Comment=Compass Reports, using Production database
Shortcuts=%Desktop%

This works on a Windows XP with Access 2010 installed. Adjust the path of your native MS Access in the commandLine parameter if needed.

Blog: http://oliah.net >> Twitter: @olivier_ahson
0 Kudos