Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Fail to create empty document! even with static lib

Hi, encounter a problem when executing myprogram.exe in other computer.

It gives me "Fail to create empty document" error. I've compiled using MFC static lib and it works in my development machine. Once I port it to one of the client machine (without VC studio) it gives me this error. I am using Daodatabase and it involves the following lines

#define DATABASEFILE "C:\\Database.mdb"

CDaoDatabase db;
CDaoRecordset recset(&db);
CString Client,Addr; // End Variables

/*******************************/
//create table
/*******************************/
     
CString lpszFile = DATABASEFILE;
db.Create(lpszFile);
     
CString SqlCmd = "CREATE TABLE MyTable(Date1 VARCHAR(20),Sensor VARCHAR(20),Backend VARCHAR(40),Reasons VARCHAR(128),SourceIP VARCHAR(20),DestIP VARCHAR(20));";

VARCHAR(40),Reasons VARCHAR(128),SourceIP VARCHAR(20),DestIP VARCHAR(20));";
     db.Execute(SqlCmd);

recset.Open(AFX_DAO_USE_DEFAULT_TYPE,"SELECT * FROM MyTable", 0);
......



i suspect it's the database excess problem. But I can run it in my dev machine, why not other machines??  is it something wrong with the dll files.. I have copied all the following dll files into the client's sytem32 but still can't work.

mfc42, mfc42d, mfcd42d, mfcn42d, mfco42d, msvcp60d, msvcrt, msvcrtd, msjet35d, msjet40d.

Can someone enlighten me...thanks in advance
0
zionv
Asked:
zionv
1 Solution
 
williamcampbellCommented:


 The program will not start without all the MFC dll's so you have those correct.

  Did you copy over C:\\Database.mdb" ?
0
 
suganthkumar1Commented:
This error message typically comes when the OnCreate function of CMainFrame Failes (return -1). Please check the code inside the OnCreate, PreCreateWindow, and the constructors of the View and document classes.

0
 
zionvAuthor Commented:
willaincampbell, I've tried copying the files but still can't run it in other computer....!!

is it something to do with the deployment when we use the DAO? I've install the jetsetup.exe already but still cannot..

suganthkumar1, if you are saying something wrong with  the code, then it shouldn't run on my development PC, but the thing is it CAN run in my dev pc and when I port it to other window based machine, it gives me this error....pls help..
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
zionvAuthor Commented:
hi all, I've tried the portion without the Daodatabase access, it works in other machines.

So what I suspect is the Components that must be installed in the client machine in order to run the Daodatabase thing.

But where should I get the list of files or dlls that must I bundled? I've tried the JetSetup.exe, but still cannot.. pls enlighten..thanks.
0
 
williamcampbellCommented:


   run depends.exe it will give you all the dll's loaded.
0
 
zionvAuthor Commented:
I"ve solved my problem. It's the DAO SDK that I need to install...thanks
0
 
moduloCommented:
PAQed, with points refunded (30)

modulo
Community Support Moderator
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now