?
Solved

Fail to create empty document! even with static lib

Posted on 2003-03-14
9
Medium Priority
?
223 Views
Last Modified: 2013-11-20
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
Comment
Question by:zionv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 12

Expert Comment

by:williamcampbell
ID: 8138081


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

  Did you copy over C:\\Database.mdb" ?
0
 

Expert Comment

by:suganthkumar1
ID: 8141935
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
 

Author Comment

by:zionv
ID: 8148766
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
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 

Author Comment

by:zionv
ID: 8149037
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
 
LVL 12

Expert Comment

by:williamcampbell
ID: 8153040


   run depends.exe it will give you all the dll's loaded.
0
 

Author Comment

by:zionv
ID: 8155997
I"ve solved my problem. It's the DAO SDK that I need to install...thanks
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11824928
PAQed, with points refunded (30)

modulo
Community Support Moderator
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question