Link to home
Start Free TrialLog in
Avatar of RupertA
RupertAFlag for United Kingdom of Great Britain and Northern Ireland

asked on

CreateWorkspace function doesn't work

I have a VB project done in VB6 which connects to an ODBC database via DAO.

Certain clients complain that the connection to the database fails and others report success. This depends on which parts of Office they have installed. A good example is if you have Excel 97 and the Data Controls part of Excel installed it works, uninstall it and no connection.

I have found that the VB code in the application bombs out at this line.

Set wrkActivate = CreateWorkspace(ODBC_WORKSPACE_NAME, "", "", dbUseODBC)

Thats right it is this 'VB CreateWorkspace function' which is a legitimate way to access the database using DAO. So as you can see I am using the ODBCDirect version of DAO to try and access Data sources through ODBC. As I am beginning to understand it, DAO is very much linked to Office and there can be several different version of DAOs installed by various versions of Microsoft Applications. Therefore it is not much of a surprise that I am experiencing problems for example when removing Excel 97 and its Data control. The CreateWorkspace function doesn't work.

I obviously don't want this to happen and seeing as people can use say either office 97/2000 and have installed whichever components they want then a developer must have experienced this problem at some time.

There must be a VB expert who can help me out here. Otherwise you would have people using this DAO connectivity for their programs and continually being told by random clients that it doesn't work for them.

Surely someone can advise me here. Now as far as I understand DAO is a common component which is available to Office and other apps. I would like someone to explain to me what I need to package with my application to make it work regardless if a user decides to uninstall Excel 97 or Excel 2000 or whatever part of Office. Or if anyone tell me what I can do to guarantee success.

I'm pretty desperate for help as the program has not been released and a frustrated client is having meetings to discuss the problem.  I can help out with any further info.
Avatar of westbrooknewmedia
westbrooknewmedia

DAO is becoming more and more unsupported.  Try distributing the DAO access DLL's with your  project.  Then if this does not work try recoding a bit... my suggestion ultimately is using the latest version of ADO, which is much more supported and much quicker.

which dao version are you using
Try installing MDAC 2.7 and JET 6 with your application, May be it could fix the problem.
Avatar of RupertA

ASKER

Hi westbrooknewmedia,

I was exporting it with DAO 3.5. Installshield automatically detects that it needs DAO350.dll and  DAO2535.tlb. Should I be exporting it with anything else?

Basker,

I've tried different versions of MDAC and that made no difference.
ASKER CERTIFIED SOLUTION
Avatar of RupertA
RupertA
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial