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
WORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBEWORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBE par JeremyJeanson
Depuis déjà un an, je conseille vivement les utilisateurs de Workflow Foundation 3 à migrer vers la version 4. L'information qui va suivre ne devrait donc pas trop prendre au dépourvu les personnes qui l'ont sagement suivi. Je profite de ce poste pour fai...
Cliquez pour lire la suite de l'article par JeremyJeanson TECHDAYS PARIS 2012 : NOUVELLES TENDANCES DU POSTE DE TRAVAIL - BRING YOUR OWN PCTECHDAYS PARIS 2012 : NOUVELLES TENDANCES DU POSTE DE TRAVAIL - BRING YOUR OWN PC par ROMELARD Fabrice
Speakers: Thierry Rapatout, Antoine Petit et Xavier Trebbia Cette session entre dans le cadre des RDV Décideurs des TechDays 2012, elle est liée à la consumérisation de l'IT et la mise en place du "DeskTop as a Service" dans de plus en ...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2012 : SYSTEM CENTER SERVICE MANAGER 2012 VUE D'ENSEMBLETECHDAYS PARIS 2012 : SYSTEM CENTER SERVICE MANAGER 2012 VUE D'ENSEMBLE par ROMELARD Fabrice
Speakers: Julien Marechal, Gautier Confiant, Sébastien MEYER La session débute par le positionnement de la solution System Center par rapport aux concepts d'organisation ITIL. Le portail du catalogue de se...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2012 : PLEINIèRE SECOND JOURTECHDAYS PARIS 2012 : PLEINIèRE SECOND JOUR par ROMELARD Fabrice
Après une première journée dédiée aux développeurs, cette seconde journée est dédiée au monde des entreprises et de ses applications. Ainsi, cette pleinière est dédiée à faire un 360 de l'évolution des applications Business aux demandes ac...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2012 : RETOUR D'EXPéRIENCE SUR LA MISE EN PLACE D'UN CLOUD PRIVéTECHDAYS PARIS 2012 : RETOUR D'EXPéRIENCE SUR LA MISE EN PLACE D'UN CLOUD PRIVé par ROMELARD Fabrice
Speaker : Guillaume Rochette Cette session est dédiée à fournir le retour sur la mise en place d'un cloud privé (IaaS) par Osiatis pour son compte ou celui de ses clients. Ce projet s'est déroulé sur 4 mois et a permis de faire évoluer...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|