Probléme de requete

gasparot Messages postés 49 Date d'inscription lundi 22 mars 2004 Statut Membre Dernière intervention 5 décembre 2006 - 25 mars 2004 à 10:45
gasparot Messages postés 49 Date d'inscription lundi 22 mars 2004 Statut Membre Dernière intervention 5 décembre 2006 - 25 mars 2004 à 12:02
Voila mon programme. J'ai un probléme a la ligne : Rsql.Open "SELECT NomSTA FROM Stagiaires WHERE Num_STA=Numero", Db
Que faire?

Dim oFSO,oTS

Set Db = CreateObject("ADODB.Connection")
Set Rs = CreateObject("ADODB.Recordset")
Set Rsql = CreateObject("ADODB.Recordset")

MaBase = "C:\recherche\test.mdb"
Db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MaBase
Rs.Open "SELECT * FROM Formations", Db
Do While Not Rs.EOF
'On affiche le numéro
'MsgBox Rs.Fields(0)

Numero = Rs("Num_STA")
Datepar = Rs("DateFin")
'MsgBox Rs.Fields(1) ou
datejour=Date()
msgbox Numero
if (datejour=Datepar) then
msgbox Numero
Rsql.Open "SELECT NomSTA FROM Stagiaires WHERE Num_STA=Numero", Db
msgbox NomSTA
supprimer_compte(NomSTA)

End If
Rs.MoveNext
Loop
msgbox "fin"
Rsql.Close
Rs.Close
Db.Close



Set Rs = Nothing
Set Db = Nothing

2 réponses

cs_wape Messages postés 262 Date d'inscription samedi 21 décembre 2002 Statut Membre Dernière intervention 19 décembre 2010 12
25 mars 2004 à 11:49
Essaye avec :

Rsql.Open "SELECT NomSTA FROM Stagiaires WHERE Num_STA=" & Numero, Db
MsgBox Rsql("NomSTA")

@+

wape
0
gasparot Messages postés 49 Date d'inscription lundi 22 mars 2004 Statut Membre Dernière intervention 5 décembre 2006
25 mars 2004 à 12:02
Merci beaucoup ca marche
0
Rejoignez-nous