General information
Title:
VFPOLEDB doesn't work
Hi,
Using the following code, I try to connect to a Visual FOXPRO database from Visual C++.
The database is named "GRM2003.DBC" and is located in the directory "C:\GRM2003".
There is no error after the compilation but while running, When the program tries to open
the connection the following error occures : "invalid path or file name".
I don't understand this error because I have checked names and pathes.
#include "stdafx.h"
#using
#using
#using
#include
using namespace System;
using namespace System::Data;
using namespace System::Data::OleDb;
void main()
{
OleDbConnection *myConnection = new OleDbConnection();
myConnection->ConnectionString="Provider=VFPOLEDB;Data Source=C:\GRM2003\GRM2003.DBC";
try
{
myConnection->Open();
Console::WriteLine(S"Connected to database successfully!");
}
catch (OleDbException * Xcp)
{
Console::Write(S"Error occured: ");
Console::WriteLine(Xcp->Message);
}
myConnection->Close();
Console::WriteLine(S"Disconnected");
}
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only