Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3022 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  [VB] Requête SQL

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[VB] Requête SQL

n°639300
Dr Raf
Roaccutane® powered
Posté le 11-02-2004 à 18:15:22  profilanswer
 

Voila je crois que j'ai un prob de requête SQL (sur une base ACCESS) mais j'arrive mais a voir le prob...  
 

Code :
  1. With Resultat
  2.     .ListItems.Clear
  3.     .ColumnHeaders.Clear
  4.     .ColumnHeaders.Add , , "Titre"
  5.     .ColumnHeaders.Add , , "Auteur"
  6.     .ColumnHeaders.Add , , "Support"
  7.     .ColumnHeaders.Add , , "Identification"
  8.    
  9. End With
  10. Form1.rst.Open "SELECT titre, auteur, support, id FROM objet WHERE (titre OR auteur) LIKE '%" & SearcH & "%' ORDER BY titre", Form1.cnx
  11.    
  12. Resultat.ListItems.Clear
  13.    
  14. If Not (Form1.rst.BOF = True Or Form1.rst.EOF = True) Then
  15.    
  16.     Set Lst = Resultat.ListItems.Add(, , Form1.rst("titre" ))
  17.     Lst.ListSubItems.Add , , Form1.rst("auteur" )
  18.     Lst.ListSubItems.Add , , Form1.rst("support" )
  19.     Lst.ListSubItems.Add , , Form1.rst("id" )
  20.        
  21. End If
  22.        
  23. Form1.rst.Close


 
prob : si SearcH <> "" g un EOF ou BOF = True


Message édité par Dr Raf le 12-02-2004 à 21:40:14
mood
Publicité
Posté le 11-02-2004 à 18:15:22  profilanswer
 

n°641074
drasche
Posté le 12-02-2004 à 23:34:28  profilanswer
 

essaie voir de balancer ta requête toute faite dans Access pour voir ce qu'il en pense (première étape de debuggage quand un tableau reste désespérément vide).
 
Euh franchement chuis pas sûr pour la syntaxe de la clause where, ce serait plutôt:
WHERE titre LIKE machin OR auteur LIKE machin


---------------
Whichever format the fan may want to listen is fine with us – vinyl, wax cylinders, shellac, 8-track, iPod, cloud storage, cranial implants – just as long as it’s loud and rockin' (Billy Gibbons, ZZ Top)
n°641091
Dr Raf
Roaccutane® powered
Posté le 12-02-2004 à 23:48:56  profilanswer
 

haaa merci ct ca ! :)
 
sinon une kestion toute bete : kan on fé un SELECT et ke la requête correspond à plusieurs valeurs pour chak champ comment on les récupères dans le recordset :??:

n°641096
drasche
Posté le 12-02-2004 à 23:52:23  profilanswer
 

tu veux dire que tu reçois plusieurs lignes? bin tu prends ton recordset et tu le parcoures [:spamafote]


---------------
Whichever format the fan may want to listen is fine with us – vinyl, wax cylinders, shellac, 8-track, iPod, cloud storage, cranial implants – just as long as it’s loud and rockin' (Billy Gibbons, ZZ Top)
n°641112
Dr Raf
Roaccutane® powered
Posté le 12-02-2004 à 23:58:18  profilanswer
 

heu... bah justement je sais pas comment on le parcours...

n°641116
drasche
Posté le 12-02-2004 à 23:59:36  profilanswer
 

cfr signature, il y a un exemple.


---------------
Whichever format the fan may want to listen is fine with us – vinyl, wax cylinders, shellac, 8-track, iPod, cloud storage, cranial implants – just as long as it’s loud and rockin' (Billy Gibbons, ZZ Top)
n°641119
Dr Raf
Roaccutane® powered
Posté le 13-02-2004 à 00:01:31  profilanswer
 

oops je savais en +...
 
bon bah merci et bonne nuit ! :jap:


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  [VB] Requête SQL

 

Sujets relatifs
SQLDelphi 2 / SQL Server 2000
Problème requête SQL (Ms SQL 2000)besoin d'aide en SQL
Créer une table avec le résultat d'une requête sous VB Access[JAVA] Accéder à une base MS Access (ou SQL Server)
Limité le nombre de lignes à l'affichage par SQL(Access) avec ASPCrystal Report et SQL server
requête SQL à optimiser 
Plus de sujets relatifs à : [VB] Requête SQL


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR