Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TAccessApplication opening db

Status
Not open for further replies.

EenOog

Programmer
Joined
May 5, 2003
Messages
1
Location
NL
Hi,

I'm having some problems with the TAccessApplication object.
I use it to open msAccess from within a cppbuilder program.

I can open access, but I cannot seem to open a database project.

when my code is executed msaccess is started and shown. but the database is not opened. I also try to open a report, but I think the problem lies with opening the db.
Is there anyone with any experience on this subject ?

the code I am using :

Access->Connect();
Access->set_Visible(true);
AnsiString path= "C:\WINDOWS\Desktop\Huurmanager\huur.mdb";

// convert ansistring to wchar_t
wchar_t wstr[100];
path.WideChar(wstr,100);

Access->OpenCurrentDatabase(wstr,false);

// set tagvariant to char*
tagVARIANT tv ;
tv.vt = VT_I1;
tv.pcVal="reportname";
Access->DoCmd->OpenReport(tv, acViewDesign, EmptyParam, EmptyParam);

thanks in advance.
 
try this

AnsiString path= "C:\\WINDOWS\\Desktop\\Huurmanager\\huur.mdb";

tomcruz.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top