Présentation
Documentation
L'équipe
Sérialisation
 
   
Programmes
Objets
Libs Utilitaires
Libs Internes
     
   
Editeur
Syntaxes
Windows
Versions
     

SCR/AL1 - TOME III. Les librairies utilitaires

25. Le groupe s_odbc

25.8 OGetTableInfo (file s_odbc.c:231)

Syntaxe

OTBL *OGetTableInfo(ODSN *odsn, char *tblname)

Description

Construit une structure contenant la définition d'une table.

Valeur retournée

Pointeur vers une structure OTBL qui contient les informations sur les colonnes de la table tblname. Pointeur nul en cas d'erreur.

Exemple

    ODSN    *odsn = 0;
OTBL *otbl = 0;
int k;

if(OInit()) {
printf("Cannot initialize ODBC\n");
return(-1);
}
odsn = OOpenDSN(dsname, user, pwd);
if(odsn == 0) {
printf("Error : Cannot open %s\n", ARG_VALUES[pos + 1]);
}
else {
otbl = OGetTableInfo(odsn, "MyTable");
if(otbl == 0)
printf("Cannot read table MyTable: %s\n", OError());
else {
for(k = 0 ; k < otbl->ncols ; k++)
printf("%d : %s[%d]\n",
k, otbl->cols[k].typename,
otbl->cols[k].len);
OFreeOTBL(otbl);
}
}
OCloseDSN(odsn);
OEnd();

Voir également

OCloseDSN(), OInit(), OEnd(), ODisplayTable()


[X-ON] [SCR4/AL1]

Copyright © 1998-2001 Jean-Marc and Bernard PAUL - Envoyez vos remarques ou commentaires à bp@xon.be