Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help!!! This is minor but urgent!
Message
De
14/12/1999 09:15:21
 
 
À
14/12/1999 00:38:57
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00303153
Message ID:
00303311
Vues:
14
>I am using Crystal Reports in my VB6 app but cannot make it display the Crystal Report when the ORDER BY clause of the sql is attached.
>Following is the code, can you give me any suggestions?
>
> Dim qryEPA As String
> Dim sDate1, sDate2 As String
> Dim sLoc1, sLoc2 As String
>
> sLoc1 = frmEPA.cmbLocFrom.Text
> sLoc2 = frmEPA.cmbLocTo.Text
>
>
> qryEPA = "Select * "
> qryEPA = qryEPA + " FROM Epa_rate"
> qryEPA = qryEPA + " WHERE (Epa_rate.Location >='" + sLoc1 + "'"
> qryEPA = qryEPA + " AND Epa_rate.Location <='" + sLoc2 + "')"
>
> '*******THIS IS WHERE THE PROBLEM OCCURS *********'
> 'If the select case statements below are commented it works
> 'properly. But when it is included, why doesn't it work?
>
> Select Case frmEPA.cmbSortKey.Text
> Case "NAME"
>     qryEPA = qryEPA + " ORDER BY Epa_rate.Name"
> Case "DIV_DEPT"
>    qryEPA = qryEPA + " ORDER BY Epa_rate.Div, Epa_rate.Dept"
> Case "EFFDATE"
>    qryEPA = qryEPA + " ORDER BY Epa_rate.EffDate"
> Case "ACTION"
>    qryEPA = qryEPA + " ORDER BY Epa_rate.Action"
> End Select
>
> CrystalReport1.Connect = "DSN=PasDSN"
> CrystalReport1.ReportFileName = "c:\pas\epa_rating.rpt"
> CrystalReport1.SQLQuery = qryEPA
> CrystalReport1.Destination = crptToWindow
> CrystalReport1.WindowState = crptMaximized

You might want to try using a field number (position) instead of the field name as in ORDER BY 1,2.. etc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform