Solved

CDatabase with Foxpro

Posted on 2000-03-30
2
333 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
[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
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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iSeries DB2 Query 2 101
sum67 challenge 35 128
EvenOdd challenge 10 160
Modbus - whats the maximum I can store in one register? 4 84
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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