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

WinDev Discussion :

Lire dans BDD ou import


Sujet :

WinDev

  1. #1
    Candidat au Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mai 2014
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Mai 2014
    Messages : 4
    Points : 3
    Points
    3
    Par défaut Lire dans BDD ou import
    Bonjour,

    Pour une appli je dois lire des infos dans une table (extérieure au projet) dois je l'importer(celle-ci évolue toutes les heures) ou simplement lire
    j'ai réalisé ce code mais il me renvoie que le fichier DETREG est inconnu (pourtant avec wdsql j'arrive à lire dans cette table

    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
    gsNomConnexion est une chaîne
    gsCheminBdD est une chaîne
    sdRequete1 est une Source de Données
    sRequetechaineSQl est une chaîne
     
    gsCheminBdD = "X:\BDD\VEGA"
    gsNomConnexion = "CNX1" 
     
    SI HDécritConnexion (gsNomConnexion, "", "", gsCheminBdD, "", hAccèsHF7, hOLecture, "") ALORS
    	SI HOuvreConnexion(gsNomConnexion)  ALORS  
    		SI PAS HChangeConnexion("GDETREG",gsNomConnexion) ALORS
    			Erreur("HChangeConnexion : "+HErreurInfo())
    		FIN 
    	SINON
    		Erreur("HOuvreConnexion : "+HErreurInfo())
    	FIN
    SINON
    	Erreur("HDécritConnexion : "+HErreurInfo())
    FIN
     
    sRequetechaineSQl =  "SELECT GDETREG.DATE, GDETREG.TOTCVD FROM GDETREG WHERE GDETREG.DATE =  '20140505'"
    SI PAS HExécuteRequêteSQL(sdRequete1,hRequêteSansCorrectionHF,sRequetechaineSQl) ALORS
    	Erreur("HExécuteRequêteSQL table GDETREG : "+HErreurInfo())
    SINON
    	HLitPremier(sdRequete1)
    	TANTQUE PAS HEnDehors(sdRequete1)
    		TableAjouteLigne(TABLE_SansNom1,COL_SansNom1,COL_SansNom2)
    		HLitSuivant(sdRequete1)
    	FIN
    FIN
    HAnnuleDéclaration(sdRequete1)
    HFermeConnexion(gsNomConnexion)
    Merci d'avance pour votre aide

  2. #2
    Membre habitué
    Homme Profil pro
    *
    Inscrit en
    Avril 2012
    Messages
    84
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Orientales (Languedoc Roussillon)

    Informations professionnelles :
    Activité : *

    Informations forums :
    Inscription : Avril 2012
    Messages : 84
    Points : 128
    Points
    128
    Par défaut
    Bonjour,
    Il faut que tu regarde tu coté de HDeclare.

    Cordialement.

  3. #3
    Candidat au Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mai 2014
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Mai 2014
    Messages : 4
    Points : 3
    Points
    3
    Par défaut
    Dois- je remplacer HDécritConnexion par hdeclare?
    ou dois-je mettre hdeclare?

    Merci


    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
    gsNomConnexion est une chaîne
    gsCheminBdD est une chaîne
    sdRequete1 est une Source de Données
    sRequetechaineSQl est une chaîne
     
    gsCheminBdD = "X:\BDD\VEGA"
    gsNomConnexion = "CNX1" 
     
    SI HDécritConnexion (gsNomConnexion, "", "", gsCheminBdD, "", hAccèsHF7, hOLecture, "") ALORS
    	SI HOuvreConnexion(gsNomConnexion)  ALORS  
    		SI PAS HChangeConnexion("GDETREG",gsNomConnexion) ALORS
    			Erreur("HChangeConnexion : "+HErreurInfo())
    		FIN 
    	SINON
    		Erreur("HOuvreConnexion : "+HErreurInfo())
    	FIN
    SINON
    	Erreur("HDécritConnexion : "+HErreurInfo())
    FIN
     
    sRequetechaineSQl =  "SELECT GDETREG.DATE, GDETREG.TOTCVD FROM GDETREG WHERE GDETREG.DATE =  '20140505'"
    SI PAS HExécuteRequêteSQL(sdRequete1,hRequêteSansCorrectionHF,sRequetechaineSQl) ALORS
    	Erreur("HExécuteRequêteSQL table GDETREG : "+HErreurInfo())
    SINON
    	HLitPremier(sdRequete1)
    	TANTQUE PAS HEnDehors(sdRequete1)
    		TableAjouteLigne(TABLE_SansNom1,COL_SansNom1,COL_SansNom2)
    		HLitSuivant(sdRequete1)
    	FIN
    FIN
    HAnnuleDéclaration(sdRequete1)
    HFermeConnexion(gsNomConnexion)

  4. #4
    Membre habitué
    Homme Profil pro
    *
    Inscrit en
    Avril 2012
    Messages
    84
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Orientales (Languedoc Roussillon)

    Informations professionnelles :
    Activité : *

    Informations forums :
    Inscription : Avril 2012
    Messages : 84
    Points : 128
    Points
    128
    Par défaut
    Moi je partirais sur ça maintenant pas sur que ce soit la bonne solution.


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    // Importe la description du fichier sous le nom FICHIERWD
    SI PAS HDéclare(sNomFichier, LEMPLACEMENT_DE_LANALYSE_DECRIVANT_TON_FICHIER,"","FICHIERWD") ALORS
    	Erreur(ErreurInfo())
    	RETOUR
    FIN
     
     
    SI PAS HOuvreConnexion(gsNomConnexion) ALORS 
    	Erreur(ErreurInfo())
    FIN
     
    HChangeConnexion("FICHIERWD", gsNomConnexion)

Discussions similaires

  1. [Débutant] [Console] Lire et verifier n'importe où dans la console
    Par johann77 dans le forum VB.NET
    Réponses: 1
    Dernier message: 18/12/2011, 23h21
  2. Importation de fichier excel dans BDD
    Par elaene dans le forum Langage
    Réponses: 15
    Dernier message: 06/05/2011, 12h28
  3. [Debutant] lire fichier text et enrgistrer dans BDD
    Par 3wicha dans le forum Windows Forms
    Réponses: 2
    Dernier message: 13/03/2008, 22h49
  4. [MySQL] importer des données .csv dans BDD MySql
    Par priscillia dans le forum PHP & Base de données
    Réponses: 2
    Dernier message: 15/06/2007, 09h40

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