diff --git a/SQL/Select/SQLSelect.vb b/SQL/Select/SQLSelect.vb index 836e8c0..747c963 100755 --- a/SQL/Select/SQLSelect.vb +++ b/SQL/Select/SQLSelect.vb @@ -196,7 +196,16 @@ Namespace SQL End If strSQL = _ - "SELECT " & DistinctClause() & TopClause() & pobjFields.SQL(Me.ConnectionType) & _ + "SELECT " & DistinctClause() + + Select Case MyBase.ConnectionType + Case Database.ConnectionType.MicrosoftAccess + Case Database.ConnectionType.SQLServer + Case Database.ConnectionType.SQLServerCompactEdition + strSQL &= TopClause() + End Select + + strSQL &= pobjFields.SQL(Me.ConnectionType) & _ " FROM " & pobjTables.SQL(Me.ConnectionType) If pbPerformLocking Then @@ -239,6 +248,14 @@ Namespace SQL End Select End If + If pintTop > 0 Then + Select Case Me.ConnectionType + Case Database.ConnectionType.MySQL, _ + Database.ConnectionType.Pervasive + strSQL &= " LIMIT " & pintTop + End Select + End If + Return strSQL End Get