Solved

CDatabase with Foxpro

Posted on 2000-03-30
2
328 Views
Last Modified: 2013-11-20
I using VC++ to program database.
How to Using CDatabase to link with dbf
file(foxpro driver).
I don't want to config it in ODBC control panel.
I want to program it in the project.
0
Comment
Question by:zhangguangcheng
2 Comments
 
LVL 4

Accepted Solution

by:
inpras earned 100 total points
ID: 2671835
if U want to configure ODBC dynamically then use SQLConfigDataSource(...); with DSN as directory containing .dbf files..

Foxpro doesn't have any thing as database so U have to take UR entire directory of .dbf files as database and each .dbf file as recordset..

Hope this helps
inpras
0
 

Expert Comment

by:ycl
ID: 2672127
Simple way:

CDatabase m_DB;
CString m_strFilePath=_T("c:\Mydbpath");

                  CString strDsn=_T("driver={Microsoft Visual Foxpro Driver};BackgroundFetch=Yes;SourceType=DBF;Exclusive=NO;SourceDB=");
                  strDsn+=m_strFilePath;
                  m_DB.OpenEx(strDsn, CDatabase::noOdbcDialog);
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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…
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now