Accueil > > > [ODBC] BIPFILE - FONCTIONS D'ACCÈS AUX BASES DE DONNÉES
[ODBC] BIPFILE - FONCTIONS D'ACCÈS AUX BASES DE DONNÉES
Information sur la source
Description
Les fonctions BipFILE ont pour but de faciliter l'accès aux bases de données. Les bases gérées actuellement sont Microsoft Jet (=Access), Microsoft SqlServeur et MySQL. Les accès se font via ODBC. Les fonctions supportent nom d'utilisateur, mot de passe, port, trusted connection, nom du serveur, ... La description des tables ou requètes est chargée automatiquement dans des structures en mémoire. Documentation complète ici : http://bipcpp.free.fr/ Un exemple des fonctions : - pour ouvrir une table : BF_TableOpen - pour lancer une requète SELECT : BF_SQLQueryOpen - pour lancer une commande INSERT, ALTER, DELETE ... : BF_SQLCommand - pour lire un enregistrement : BF_RecordReadNext - pour récupérer les valeurs : BF_FieldValueGetString, BF_FieldValueGetInteger, BF_FieldValueGetDate, ... - pour fermer la table : BF_TableClose
Source
- Un extrait du .h :
- --------------------
-
- // table functions
- int BF_TableOpen (const string sBFName, const string sBFTableName, const string sBFDbName,
- const string sBFSrvName, const string sBFDbType, const string sBFParam = "");
- // sBFParam = ""
- int BF_TableClose (const string sBFName);
- BF_STRUCT_TABLE BF_TableGet (const string sBFTable);
- BF_STRUCT_TABLE BF_TableNullGet (void);
- int BF_SQLRecordDescriptionLoad (const string sBFName);
- int BF_SQLQueryDescriptionLoad (const string sBFName);
- int BF_BDBRecordDescriptionLoad (const string sBFName);
- int BF_BDBRecordDescriptionSave (const string sBFName, const string sBFRecord);
-
-
- // field functions
- int BF_FieldAdd (const string sBFName, const string sBFFieldName,
- const string sBFInterType, const int iBFFieldLength,
- const string sBFDbType, const bool bBFDbNull,
- const string sBFDbRemark = "", const string sBFDbDefValue = "",
- const int iBFDbDecimal = 0);
- // sBFDbRemark = "", sBFDbDefValue = "", iBFDbDecimal = 0
- BF_STRUCT_FIELD BF_FieldGet (const string sBFTable, const string sBFField);
- string BF_FieldNameGet (const string sBFTable, const int iBFOrder);
- string BF_FieldValueGetString (const string sBFName, const string sBFField);
- string BF_FieldValueGetString (const string sBFName, const int iBFOrder);
- long BF_FieldValueGetInteger (const string sBFName, const string sBFField);
- long BF_FieldValueGetInteger (const string sBFName, const int iBFOrder);
- LONGLONG BF_FieldValueGetLongLong (const string sBFName, const string sBFField);
- LONGLONG BF_FieldValueGetLongLong (const string sBFName, const int iBFOrder);
- double BF_FieldValueGetFloat (const string sBFName, const string sBFField);
- double BF_FieldValueGetFloat (const string sBFName, const int iBFOrder);
- BP_Date BF_FieldValueGetDate (const string sBFName, const string sBFField);
- BP_Date BF_FieldValueGetDate (const string sBFName, const int iBFOrder);
- BP_Currency BF_FieldValueGetCurrency (const string sBFName, const string sBFField);
- BP_Currency BF_FieldValueGetCurrency (const string sBFName, const int iBFOrder);
- BF_STRUCT_FIELD BF_FieldNullGet (void);
- int BF_FieldSetString (const string sBFName, const string sBFField,
- const string sBFValue, const bool bBFNull = false);
- // const bool bBFNull = false
- int BF_FieldSetInteger (const string sBFName, const string sBFField,
- const long lBFValue, const bool bBFNull = false);
- // const bool bBFNull = false
- int BF_FieldSetLongLong (const string sBFName, const string sBFField,
- const LONGLONG llBFValue, const bool bBFNull = false);
- // const bool bBFNull = false
- int BF_FieldSetFloat (const string sBFName, const string sBFField,
- const double dBFValue, const bool bBFNull = false);
- // const bool bBFNull = false
- int BF_FieldSetDate (const string sBFName, const string sBFField,
- BP_Date dtBFValue, const bool bBFNull = false);
- // const bool bBFNull = false
- int BF_FieldSetCurrency (const string sBFName, const string sBFField,
- BP_Currency curBFValue, const bool bBFNull = false);
- // const bool bBFNull = false
- BF_STRUCT_FIELD BF_SQLQueryFieldGet (const string sBFTable, const int iBFOrder);
-
-
- // record functions
- int BF_RecordReadNext (const string sBFName);
- int BF_RecordSave (const string sBFName);
- int BF_RecordPrepare (string sBFName);
-
-
- // SQL functions
- string BF_SQLQueryOpen (const string sBFQueryName, const string sBFSQLQuery,
- const string sBFDbName, const string sBFSrvName,
- const string sBFDbType, const string sBFParam = "");
- // sBFParam = ""
- string BF_SQLCommand (const string sBFSQLCommand, const string sBFDbName,
- const string sBFSrvName, const string sBFDbType, const string sBFParam);
- string BF_SQLConnectStringGet (const string sBFDbName, const string sBFSrvName,
- const string sBFDbType, const string sBFParam);
-
- // other functions
- void BF_ResetBipFILEIntl (void);
- void BF_ErrorSet (const string sBFName, const string sBFFunction, const string sBFParam);
- string BF_ErrorDisplay (const int iBFError);
- void BF_ErrorDisplaySet (const bool bBFError = true, const bool bBFWrite = false);
- // bBFError = true, bBFWrite = false
-
-
- string BF_IntToString (const long iLong);
- int BF_StringToInt (const string sString, const int iBase = 10);
- // iBase = 10
- string BF_LongLongToString (const LONGLONG iLong);
- LONGLONG BF_StringToLongLong (const string sString);
- string BF_DoubleToString (const double dDouble);
- string BF_StringToUpper (const string sString);
- string BF_StringParamGetIntl (const string sBFParam, const string sBFString);
- bool BF_StringIsTrue (const string sBFInput);
- bool BF_StringIsFalse (const string sBFInput);
Un extrait du .h :
--------------------
// table functions
int BF_TableOpen (const string sBFName, const string sBFTableName, const string sBFDbName,
const string sBFSrvName, const string sBFDbType, const string sBFParam = "");
// sBFParam = ""
int BF_TableClose (const string sBFName);
BF_STRUCT_TABLE BF_TableGet (const string sBFTable);
BF_STRUCT_TABLE BF_TableNullGet (void);
int BF_SQLRecordDescriptionLoad (const string sBFName);
int BF_SQLQueryDescriptionLoad (const string sBFName);
int BF_BDBRecordDescriptionLoad (const string sBFName);
int BF_BDBRecordDescriptionSave (const string sBFName, const string sBFRecord);
// field functions
int BF_FieldAdd (const string sBFName, const string sBFFieldName,
const string sBFInterType, const int iBFFieldLength,
const string sBFDbType, const bool bBFDbNull,
const string sBFDbRemark = "", const string sBFDbDefValue = "",
const int iBFDbDecimal = 0);
// sBFDbRemark = "", sBFDbDefValue = "", iBFDbDecimal = 0
BF_STRUCT_FIELD BF_FieldGet (const string sBFTable, const string sBFField);
string BF_FieldNameGet (const string sBFTable, const int iBFOrder);
string BF_FieldValueGetString (const string sBFName, const string sBFField);
string BF_FieldValueGetString (const string sBFName, const int iBFOrder);
long BF_FieldValueGetInteger (const string sBFName, const string sBFField);
long BF_FieldValueGetInteger (const string sBFName, const int iBFOrder);
LONGLONG BF_FieldValueGetLongLong (const string sBFName, const string sBFField);
LONGLONG BF_FieldValueGetLongLong (const string sBFName, const int iBFOrder);
double BF_FieldValueGetFloat (const string sBFName, const string sBFField);
double BF_FieldValueGetFloat (const string sBFName, const int iBFOrder);
BP_Date BF_FieldValueGetDate (const string sBFName, const string sBFField);
BP_Date BF_FieldValueGetDate (const string sBFName, const int iBFOrder);
BP_Currency BF_FieldValueGetCurrency (const string sBFName, const string sBFField);
BP_Currency BF_FieldValueGetCurrency (const string sBFName, const int iBFOrder);
BF_STRUCT_FIELD BF_FieldNullGet (void);
int BF_FieldSetString (const string sBFName, const string sBFField,
const string sBFValue, const bool bBFNull = false);
// const bool bBFNull = false
int BF_FieldSetInteger (const string sBFName, const string sBFField,
const long lBFValue, const bool bBFNull = false);
// const bool bBFNull = false
int BF_FieldSetLongLong (const string sBFName, const string sBFField,
const LONGLONG llBFValue, const bool bBFNull = false);
// const bool bBFNull = false
int BF_FieldSetFloat (const string sBFName, const string sBFField,
const double dBFValue, const bool bBFNull = false);
// const bool bBFNull = false
int BF_FieldSetDate (const string sBFName, const string sBFField,
BP_Date dtBFValue, const bool bBFNull = false);
// const bool bBFNull = false
int BF_FieldSetCurrency (const string sBFName, const string sBFField,
BP_Currency curBFValue, const bool bBFNull = false);
// const bool bBFNull = false
BF_STRUCT_FIELD BF_SQLQueryFieldGet (const string sBFTable, const int iBFOrder);
// record functions
int BF_RecordReadNext (const string sBFName);
int BF_RecordSave (const string sBFName);
int BF_RecordPrepare (string sBFName);
// SQL functions
string BF_SQLQueryOpen (const string sBFQueryName, const string sBFSQLQuery,
const string sBFDbName, const string sBFSrvName,
const string sBFDbType, const string sBFParam = "");
// sBFParam = ""
string BF_SQLCommand (const string sBFSQLCommand, const string sBFDbName,
const string sBFSrvName, const string sBFDbType, const string sBFParam);
string BF_SQLConnectStringGet (const string sBFDbName, const string sBFSrvName,
const string sBFDbType, const string sBFParam);
// other functions
void BF_ResetBipFILEIntl (void);
void BF_ErrorSet (const string sBFName, const string sBFFunction, const string sBFParam);
string BF_ErrorDisplay (const int iBFError);
void BF_ErrorDisplaySet (const bool bBFError = true, const bool bBFWrite = false);
// bBFError = true, bBFWrite = false
string BF_IntToString (const long iLong);
int BF_StringToInt (const string sString, const int iBase = 10);
// iBase = 10
string BF_LongLongToString (const LONGLONG iLong);
LONGLONG BF_StringToLongLong (const string sString);
string BF_DoubleToString (const double dDouble);
string BF_StringToUpper (const string sString);
string BF_StringParamGetIntl (const string sBFParam, const string sBFString);
bool BF_StringIsTrue (const string sBFInput);
bool BF_StringIsFalse (const string sBFInput);
Conclusion
En exemple, vous trouverez un frontal SQL (voir copie d'écran) qui permet de lancer toutes les requètes SQL (SELECT, UNION, HAVING, GROUP BY, ...) et commandes SQL (ALTER, DROP, INSERT, UPDATE, DELETE, ...) reconnues par la base SQL.
La source et l'executable sont ici : http://bipcpp.free.fr/fr/bipfile/demosql-v110.zip C'est un exe de 330 ko qui est autonomme, pas d'installation, pas de modification de la base de registre, ... le seul prérequis est l'installation du driver ODBC de votre base de données.
Historique
- 13 décembre 2005 19:52:33 :
- Modification des commentaires.
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
interface access sur oracle avec odbc [ par plantachou ]
bonjourj'arrive a recuperer sur access ma base oracle avec ODBC mais je sais pas comment faire pour modifier ou ajouter des données a ma table oracle
Les grandes tables Access et ODBC [ par Michel Caramez ]
Bonjour,Je travail sur un système de récupération de données en C++ via un ODBC sur une table MS Access. j'ai développé une mini application. Mais voi
ecrire dans une base de données access grâce à ODBC [ par volcomboy1 ]
BonjourPourriez vous m'expliquer comment on fait pour créer des nouveau champs et des nouveau enregistrements dans une base de données acces grâce a o
créer une table nomé image en Access par SQL [ par monimon18 ]
bonjour je veut créér une table nomé image en code SQL en ACCESS mais je ne sais pas pourquoi ça marche pas; create table image(champ1 int,champ2 int)
C++.NET Odbc Connection à une base access [ par baptistemazet ]
Bonjour, jessaye d'établir une connection à une base de données access, pour alors l'attaquer par des requetes SQL, le problème es
variable dans requete SQL sous ODBC [ par 0Cypher0 ]
Salut tout le monde, Voila, j'ai un petit PB que je n'arrive pas a resoudre. Je voudrais passer une requete SQL via ODBC, ce qui fonctionne pour une
MFC connexion a une bas Access (ODBC) [ par gadafla ]
Lorsque je cree un projet MFC avec les fonctionnalites d'une connexion ODBC a une base Access (avec Visual Studio, bien entendu), j'arrive a lire des
Problème de deconnection de l'odbc(c++) [ par seleccao ]
Bonjours à tous!! Je suis entrain de faire un programme qui utilise la base de donnée excel, j'essaye de me deconnecté de mon odbc en ihm mais je n'y
Requete stockee access via odbc [ par GLOBUL03 ]
Bonsoir,Je me connecte à une base de données ACCESS via ODBC avec la classe MFC CDataBase.Pour executer une requete stockee, j'utilise
ODBC en C [ par oxifis974 ]
Bonjour tout le mondeJe cherche a me connecter à une base de données en C. SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv); // la version d
|
Derniers Blogs
[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2010 : PLAN DE MIGRATION VERS SHAREPOINT 2010TECHDAYS PARIS 2010 : PLAN DE MIGRATION VERS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Arnault Nouvel et Antoine Dongois Le processus à prendre : Apprendre (découvrir la plateforme) Préparer (documenter l'historique et choisir la méthode de MAJ) Test (Test de MAJ) Implémenter (Effectuer la MAJ) Valid...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2010 : LA PLEINIèRE DU SECOND JOURTECHDAYS PARIS 2010 : LA PLEINIèRE DU SECOND JOUR par ROMELARD Fabrice
Après un retour sur l'histoire des TechDays de Paris et le fait que ce soit le plus gros event MS au monde (du fait de sa gratuité), le président de MS France (Eric Boustoullier) a fait une présentation de la vision Microsoft pour les années à venir...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Forum
WIN APIWIN API par omarino_007
Cliquez pour lire la suite par omarino_007
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
Comparez les prix

HTC Hero
Entre 550€ et 550€
|