IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bases de données Delphi Discussion :

l'impossibilité de créer une table paradox de plus de 13 champs


Sujet :

Bases de données Delphi

  1. #1
    Membre du Club
    Inscrit en
    Décembre 2007
    Messages
    246
    Détails du profil
    Informations forums :
    Inscription : Décembre 2007
    Messages : 246
    Points : 62
    Points
    62
    Par défaut l'impossibilité de créer une table paradox de plus de 13 champs
    je n'arrive pas a creer une table paradox de plus de 13 champs avec CreateTable.
    il m'affiche le message suivant:


  2. #2
    Expert éminent sénior

    Avatar de Nono40
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2002
    Messages
    8 640
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 56
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Industrie

    Informations forums :
    Inscription : Mai 2002
    Messages : 8 640
    Points : 19 101
    Points
    19 101
    Par défaut
    Comment definis-tu les champs ? Car il n'y a pas de limitation normalement.
    Delphi :
    La F.A.Q. , 877 réponses à vos questions !
    264 sources à consulter/télécharger !

  3. #3
    Membre du Club
    Inscrit en
    Décembre 2007
    Messages
    246
    Détails du profil
    Informations forums :
    Inscription : Décembre 2007
    Messages : 246
    Points : 62
    Points
    62
    Par défaut
    vous parlez de leurs types ?

  4. #4
    Membre émérite Avatar de edam
    Homme Profil pro
    Développeur Delphi/c++/Omnis
    Inscrit en
    Décembre 2003
    Messages
    1 894
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Développeur Delphi/c++/Omnis
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Décembre 2003
    Messages : 1 894
    Points : 2 771
    Points
    2 771
    Par défaut
    pourquoi pas utilisé Fb au lieu de paradox??
    voir: lien1 et lien2
    PAS DE DESTIN, C'EST CE QUE NOUS FAISONS

  5. #5
    Expert éminent sénior

    Avatar de Nono40
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2002
    Messages
    8 640
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 56
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Industrie

    Informations forums :
    Inscription : Mai 2002
    Messages : 8 640
    Points : 19 101
    Points
    19 101
    Par défaut
    Non je ne parle pas des types mais de la méthode utilisée. Voire de l'extrait de code en question.
    Delphi :
    La F.A.Q. , 877 réponses à vos questions !
    264 sources à consulter/télécharger !

  6. #6
    Membre émérite
    Homme Profil pro
    Directeur technique
    Inscrit en
    Mai 2008
    Messages
    2 401
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Directeur technique
    Secteur : Service public

    Informations forums :
    Inscription : Mai 2008
    Messages : 2 401
    Points : 2 304
    Points
    2 304
    Par défaut
    Citation Envoyé par messahel Voir le message
    je n'arrive pas a creer une table paradox de plus de 13 champs avec CreateTable.
    il m'affiche le message suivant:

    le message d'erreur ne dit en aucun cas qu'il est impossible de créer une table paradox de plus de 13 champs !
    utilises le pas à pas pour localiser la portion du code qui provoque cette erreur.
    Bon courage ou Bonne Chance (selon le contexte)
    Mon blog sur WordPress

  7. #7
    Membre du Club
    Inscrit en
    Décembre 2007
    Messages
    246
    Détails du profil
    Informations forums :
    Inscription : Décembre 2007
    Messages : 246
    Points : 62
    Points
    62
    Par défaut
    voici le code que j'ai utilise pour creer une table Paradox:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    procedure TForm1.createtablemariage(i:integer);
    var table1:ttable;
    begin
    table1:=ttable.Create(table1);
    with Table1 do begin
    Active :=False;
    DatabaseName :=chemin;        // chemin:=ExtractFilePath(Application.ExeName);
    TableType :=ttParadox;
    TableName :='mariage'+inttostr(i);
     
    if not Table1.Exists then begin
    with FieldDefs do begin
    Clear;
     
    with AddFieldDef do begin
    Name :='Numero';
    DataType :=ftautoinc;
    end;
     
    with AddFieldDef do begin
    Name :='Datemariage';
    DataType :=ftdate;
    end;
     
    with AddFieldDef do begin
    Name :='Marie';
    DataType :=ftString;
    Size :=50;
    end;
     
    with AddFieldDef do begin
    Name :='Profession1';
    DataType :=ftString;
    Size :=20;
    end;
     
    with AddFieldDef do begin
    Name :='Datedenaiss1';
    DataType :=ftdate;
    end;
     
    with AddFieldDef do begin
    Name :='Lieu1';
    DataType :=ftString;
    Size :=20;
    end;
     
    with AddFieldDef do begin
    Name :='Pere1';
    DataType :=ftString;
    Size :=30;
    end;
     
    with AddFieldDef do begin
    Name :='Mere1';
    DataType :=ftString;
    Size :=50;
    end;
     
    with AddFieldDef do begin
    Name :='Mariee';
    DataType :=ftString;
    Size :=50;
    end;
     
    with AddFieldDef do begin
    Name :='Profession2';
    DataType :=ftString;
    Size :=20;
    end;
     
    with AddFieldDef do begin
    Name :='Datedenaiss2';
    DataType :=ftdate;
    end;
     
    with AddFieldDef do begin
    Name :='Lieu2';
    DataType :=ftString;
    Size :=20;
    end;
     
    with AddFieldDef do begin
    Name :='Pere2';
    DataType :=ftString;
    Size :=30;
    end;
     
    with AddFieldDef do begin
    Name :='Mere2';
    DataType :=ftString;
    Size :=50;
    end;
     
    with AddFieldDef do begin
    Name :='Enfrancais1';
    DataType :=ftString;
    Size :=50;
    end;
     
    with AddFieldDef do begin
    Name :='Enfrancais2';
    DataType :=ftString;
    Size :=50;
    end;
     
    end;
     
    with IndexDefs do begin
    Clear;
     
    with AddIndexDef do begin
    Name :='';
    Fields :='Numero';
    Options :=[ixPrimary];
    end;
     
    end;
    CreateTable;
    end;
    end;
    end;
    qui peut m'indiquer l'erreur svp ?

  8. #8
    Expert éminent sénior
    Avatar de ShaiLeTroll
    Homme Profil pro
    Développeur C++\Delphi
    Inscrit en
    Juillet 2006
    Messages
    13 449
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Développeur C++\Delphi
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 13 449
    Points : 24 856
    Points
    24 856
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     table1:=ttable.Create(table1);
    à remplacer par
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
      table1:=ttable.Create(Self);
    sinon, apprends à indenter ton code, c'est imbuvable !!!

    En général, j'utilise plutôt la méthode Add et non AddFieldDef, c'est nettement plus concis !

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    procedure TForm1.createtablemariage(i:integer);
    var 
      table1:ttable;
    begin
      table1:=ttable.Create(table1);
      with Table1 do
      begin
        Active :=False;
        DatabaseName :=chemin;        // chemin:=ExtractFilePath(Application.ExeName);
        TableType := ttParadox;
        TableName :='mariage'+inttostr(i);
     
        if not Table1.Exists then
        begin
          with FieldDefs do
          begin
            Clear;
     
            with AddFieldDef do
            begin
              Name :='Numero';
              DataType :=ftautoinc;
            end;
     
            with AddFieldDef do
            begin
              Name :='Datemariage';
              DataType :=ftdate;
            end;
     
            with AddFieldDef do
            begin
              Name :='Marie';
              DataType :=ftString;
              Size :=50;
            end;
     
            with AddFieldDef do
            begin
              Name :='Profession1';
              DataType :=ftString;
            Size :=20;
            end;
     
            with AddFieldDef do
            begin
              Name :='Datedenaiss1';
              DataType :=ftdate;
            end;
     
            with AddFieldDef do
            begin
              Name :='Lieu1';
              DataType :=ftString;
              Size :=20;
            end;
     
            with AddFieldDef do
            begin
              Name :='Pere1';
              DataType :=ftString;
              Size :=30;
            end;
     
            with AddFieldDef do
            begin
              Name :='Mere1';
              DataType :=ftString;
              Size :=50;
            end;
     
            with AddFieldDef do
            begin
              Name :='Mariee';
              DataType :=ftString;
              Size :=50;
            end;
     
            with AddFieldDef do
            begin
              Name :='Profession2';
              DataType :=ftString;
              Size :=20;
            end;
     
            with AddFieldDef do
            begin
              Name :='Datedenaiss2';
              DataType :=ftdate;
            end;
     
            with AddFieldDef do
            begin
              Name :='Lieu2';
              DataType :=ftString;
              Size :=20;
            end;
     
            with AddFieldDef do
            begin
              Name :='Pere2';
              DataType :=ftString;
              Size :=30;
            end;
     
            with AddFieldDef do
            begin
            	Name :='Mere2';
            	DataType :=ftString;
            	Size :=50;
            end;
     
            with AddFieldDef do
            begin
              Name :='Enfrancais1';
              DataType :=ftString;
              Size :=50;
            end;
     
            with AddFieldDef do
            begin
              Name :='Enfrancais2';
              DataType :=ftString;
              Size :=50;
            end;   
          end;
     
          with IndexDefs do
          begin
     
            Clear;
     
            with AddIndexDef do
            begin
              Name :='';
              Fields :='Numero';
              Options :=[ixPrimary];
            end;
     
          end;
     
          CreateTable;
        end;
      end;
    end;
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    procedure TForm1.createtablemariage(i:integer);
    var 
      table1:ttable;
    begin
      table1:=ttable.Create(table1);
      with Table1 do
      begin
        Active :=False;
        DatabaseName :=chemin;        // chemin:=ExtractFilePath(Application.ExeName);
        TableType := ttParadox;
        TableName :='mariage'+inttostr(i);
     
        if not Table1.Exists then
        begin
          with FieldDefs do
          begin
            Clear;   
            Add('Numero', ftautoinc);
            Add('Datemariage', ftdate);
            Add('Marie', ftString, 50);
            Add('Profession1', ftString, 20);
            Add('Datedenaiss1', ftdate);
            Add('Lieu1', ftString, 20);
            Add('Pere1', ftString, 30);
            Add('Mere1', ftString, 50);
            Add('Mariee', ftString, 50);
            Add('Profession2', ftString, 20);
            Add('Datedenaiss2', ftdate);
            Add('Lieu2', ftString, 20);
            Add('Pere2', ftString, 30);
            Add('Mere2', ftString, 50);    
            Add('Enfrancais1', ftString, 50);   
            Add('Enfrancais2', ftString, 50);
     
          end;
     
          IndexDefs.Clear;
          IndexDefs.Add('', 'Numero', [ixPrimary]);
     
          CreateTable;
        end;
      end;
    end;
    Aide via F1 - FAQ - Guide du développeur Delphi devant un problème - Pensez-y !
    Attention Troll Méchant !
    "Quand un homme a faim, mieux vaut lui apprendre à pêcher que de lui donner un poisson" Confucius
    Mieux vaut se taire et paraître idiot, Que l'ouvrir et de le confirmer !
    L'ignorance n'excuse pas la médiocrité !

    L'expérience, c'est le nom que chacun donne à ses erreurs. (Oscar Wilde)
    Il faut avoir le courage de se tromper et d'apprendre de ses erreurs

  9. #9
    Membre du Club
    Inscrit en
    Décembre 2007
    Messages
    246
    Détails du profil
    Informations forums :
    Inscription : Décembre 2007
    Messages : 246
    Points : 62
    Points
    62
    Par défaut
    Merci ShaileTroll, le probleme est resolu apres le remplacement de Table1 dans la creation de la table par Self.

    et merci aussi pour la simplification dans l'addition des champs.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Créer dynamiquement une table Paradox sous DELPHI
    Par tarbala dans le forum Bases de données
    Réponses: 2
    Dernier message: 04/03/2009, 10h15
  2. [TQuery] Créer une table Paradox avec mots de passe
    Par bsdocuments dans le forum Bases de données
    Réponses: 4
    Dernier message: 06/03/2007, 15h46
  3. trouver et remplacer dans une table paradox
    Par Yepazix dans le forum Bases de données
    Réponses: 3
    Dernier message: 23/09/2004, 02h19
  4. Migration d'une table PARADOX
    Par DanielW dans le forum Débuter
    Réponses: 6
    Dernier message: 06/05/2004, 21h52
  5. Comment créer une Table dans 1 Bdd ACCESS avec Builder??
    Par makandja dans le forum C++Builder
    Réponses: 6
    Dernier message: 17/03/2004, 20h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo