Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Method 'Execute' of object '_Connection' failed
Message
From
18/02/2002 13:30:48
 
 
To
15/02/2002 10:14:11
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00620662
Message ID:
00621600
Views:
15
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
Previous
Reply
Map
View

Click here to load this message in the networking platform