cs_serge99
Messages postés78Date d'inscriptionlundi 29 août 2005StatutMembreDernière intervention14 octobre 2006
-
2 mars 2006 à 22:43
cs_serge99
Messages postés78Date d'inscriptionlundi 29 août 2005StatutMembreDernière intervention14 octobre 2006
-
3 mars 2006 à 17:56
Bonjour,
J'ai besoin d'aide. Ma requete ne fonctionne pas... point virgule absent ????????
voici ma requête... quel est le problème?
SQLstmt "INSERT INTO trunk (Extrémité1, Extrémité2) VALUES ('combo100.caption', 'combo13.caption') SELECT troncon FROM trunk WHERE troncon " & LabelTroncon.Caption & ""
cs_serge99
Messages postés78Date d'inscriptionlundi 29 août 2005StatutMembreDernière intervention14 octobre 2006 3 mars 2006 à 16:02
Je n'y arrive pas...
Étant débutant, pourriez-vous m'indiquer comment exécuter 2 requêtes séparéments... tout se que j'ai fait jusqu'a présent ne fonctionne pas ou plutot partiellement. Vb m'envoie le message d'erreur suivant:
Erreur de syntaxe (opérateur absent) dans l'expression ' troncon= T4000-100-25 INSERT INTO trunk (Extrémité1,Extrémité2) VALUES ('PHD2-23','M201')'
je ne sais plus quoi faire
Voici ma dernière tentative:
SQLstmt "SELECT troncon FROM trunk WHERE troncon " & LabelTroncon.Caption & " "
SQLstmt = SQLstmt & "INSERT INTO trunk (Extrémité1, Extrémité2) VALUES ('" & Combo100.Text & "', '" & Combo13.Text & "')"
'******************************************************************************
' Obetnir les enregistrements
Set rstrunk = New ADODB.Recordset
rstrunk.Open SQLstmt, connbd1, adOpenStatic, adLockOptimistic, _
adCmdText
'******************************************************************************
cs_serge99
Messages postés78Date d'inscriptionlundi 29 août 2005StatutMembreDernière intervention14 octobre 2006 3 mars 2006 à 17:56
J'ai trouvé... yes ;-)
merci de votre aide... mais j'ai fait autre chose...loop;-)
Voici ce que j'ai fait et ça fonctionne à merveille:
'******************************************************************************SQLstmt "SELECT troncon,Extrémité1,Extrémité2 FROM trunk WHERE N°idtrunk " & LabelTroncon.Caption & " "
'******************************************************************************
' Obtenir les enregistrements
Set rstrunk = New ADODB.Recordset
rstrunk.Open SQLstmt, connbd1, adOpenStatic, adLockOptimistic, _
adCmdText
'******************************************************************************
With rstrunk
For i = 0 To LabelTroncon.Caption
If LabelTroncon.Caption = i Then
.Fields("Extrémité1") = Combo100.Text
.Fields("Extrémité2") = Combo13.Text
.MoveNext
End If
Next i
End With