Link to home
Start Free TrialLog in
Avatar of cjmoim
cjmoim

asked on

VB application is not runnig


I made an VB application, and it works perfectly fine
with my computer, but it is not running with other computers..I can install my application to other computers, and it loads the main screen, but whenever
I type the id and password, it shows the error message.
It seems like it can not get the information from
my MAINDB.mdb file..

I referenced Microsoft DAO 3.6 Object Library, and
used DAO method for getting data from Access database.

What might be the problem??
Please Help me out guys!!
Avatar of willisp
willisp

Is MAINDB.mdb included with the installation?
Avatar of cjmoim

ASKER

Yes MAINDB.mdb is included
DAO 3.6 must have been installed on the target machine.
Is the DB marked read-only (frequently happens with a copy from CD) on the client machine?
Check the connection string to make sure you do not have an absolute path to your hard drive.

If the DB is in the same folder as the .exe, set the path to App.Path & "\MAINDB.mdb" or possibly "MAINDB.mdb" without a path.

It definitely shouldn't have "C:\...\MAINDB.mdb" unless you plan to create that path on the user's machine.
download and install the MDAC on the target machine
also, try switching over to ADO which is more advanced than DAO

http://download.microsoft.com/download/dasdk/Install/2.70/W98NT42KMe/EN-US/mdac_typ.exe

muskad202
Avatar of cjmoim

ASKER


I can not swich from DAO to ADO with this program since there will be a lot of changes on it.I am using DAO 3.6 ...And the following is the code for open database..


CurPath = App.Path
 If Right(CurPath, 1) <> "\" Then CurPath = CurPath + "\"
 Dim LoginDB As Database
 Dim LoginTB As Recordset
 
 Set LoginDB = OpenDatabase(CurPath & "MAINDB.MDB")


When I run the program from other machines, then click login button,  The error message is appears, it says Runtime error'3343' Unrecognized database format.  

The strange part is that if I run that .exe file from Support folder, then it runs perfect.  The Support folder
is the one that automatically made from package and diployment wizard..







>if I run that .exe file from Support folder, then it runs perfect

then you definitely have some sort of path problem.

I'd suggest trying this:

...
msgbox CurPath & "MAINDB.MDB"
Set LoginDB = OpenDatabase(CurPath & "MAINDB.MDB")
...

This may give you some clues since sometimes the path that you expect is not what you get.  Furthermore, I'd recommend using a variable to hold the path rather than the CurPath unless you specifically want to change the user's system to point to this path.
ASKER CERTIFIED SOLUTION
Avatar of twalgrave
twalgrave

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
Avatar of Éric Moreau
Are you using Data Controls? In this case, have a look at http://support.microsoft.com/default.aspx?scid=kb;en-us;238401
Sounds to me as if necessary DLL's were not registered.

Try to copy the DLL's from the Support-Directory into Windows\System (Win98) or \WinNT\System32 (WinNT) directory. Then run the Command-Prompt, change directory to System (or System32, look above) and start "regsvr32.exe NameOfDll.dll" for each required DLL.

(I made a small .bat to do this for me (+Switch /s for silent mode).

That way I can make sure all necessary Dll's are registered and I don't need to distribute a Setup-Utility.