Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFPOLEDB doesn't work
Message
From
15/03/2003 10:55:43
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
VFPOLEDB doesn't work
Miscellaneous
Thread ID:
00766180
Message ID:
00766180
Views:
61
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
Map
View

Click here to load this message in the networking platform