Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFPOLEDB doesn't work
Message
De
15/03/2003 10:55:43
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
VFPOLEDB doesn't work
Divers
Thread ID:
00766180
Message ID:
00766180
Vues:
60
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");
}
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform