Skip to content

Commit

Permalink
Added support for MySQL SELECT LIMIT command via the SQLSelect.Top pr…
Browse files Browse the repository at this point in the history
…operty. Closes #53.
  • Loading branch information
hisystems committed May 5, 2012
1 parent 99389fc commit 6792150
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion SQL/Select/SQLSelect.vb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6792150

Please sign in to comment.