Skip to Content
0

How can change database location (.mdb : Access) in C++ (MFC)

Sep 14, 2017 at 04:42 PM

46

avatar image
Former Member

Hello;

I'm on Visual studio 2010. My code is in C++ (MFC)

My question is simple:

My ".rpt" file use (point) an Access database located in "c:\.....\user111\myDatabase.mdb"

I need to change "AT RUN-TIME" the le location of my database to "c:\.....\user222\myDatabase.mdb"

I need to do this because "myDatabase.mdb" are storted in LocalAppData, so the path change from a user (user111) to another one (user222).

Remarque : I Can't changes install rules of company.

Best Regards,

Ridha

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

avatar image
Former Member Sep 15, 2017 at 08:03 AM
0

Good Morning,

I use the version 13 of crystal reports on visual studio c++ 2010.

I foud some topics about this, i must do something like that :

for(int i = 0 ; i < crReportDocument->Database->Tables->Count ; i++)
{
IDatabaseTablePtr theTablePtr = crReportDocument->Database->Tables->Item;

theTablePtr.setDataSource (...);

}

but it not work because datastruct and methodes are not good.

Best Regards,

Ridha.

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Sep 14, 2017 at 04:43 PM
0

What CR SDK are you using?

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Good Morning,

I use the version 13 of crystal reports on visual studio c++ 2010.

Best Regards.

Ridha

0
Don Williams
Sep 15, 2017 at 05:43 PM
0
Share
10 |10000 characters needed characters left characters exceeded