Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Method 'Execute' of object '_Connection' failed
Message
De
18/02/2002 13:30:48
 
 
À
15/02/2002 10:14:11
Hee Chee
International Paper
Savannah, Georgie, États-Unis
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00620662
Message ID:
00621600
Vues:
9
This is how I usually do it:

Private Sub cmdGo_Click()
Dim rsContractDetailInfo As ADODB.Recordset
Set rsContractDetailInfo = New ADODB.Recordset

Dim sql as string

sql = "SELECT Contract_Number, Creation_Date, Origin_Code, Destination_Code, Species_Code, Product_Code, Zone, " & _
" Min(Begin_Date) AS MinOfBegin_Date, Max(End_Date) AS MaxOfEnd_Date, Min(Rate_Begin_Date) as MinOfRateBegin_Date, Max(Rate_End_Date) as MaxOfRateEnd_Date " & _
" FROM CONTRACT_DETAIL " & _
" GROUP BY Contract_Number, Creation_Date, Origin_Code, Destination_Code, Species_Code, Product_Code, Zone " & _
" Having CONTRACT_NUMBER = 'AH999' And CREATION_DATE = #" & Format("5/14/2001 9:58:41 AM", "mm/dd/yyyy hh:mm:ss") & "# "

rsContractDetailInfo.open sql, conn, adOpenDynamic, adLockPessimistic, adCmdText

End Sub

Just a suggestion!

Nichole Brelje
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform