Add a definable row limit to 'View Data'

Поиск
Список
Период
Сортировка
От frank_lupo
Тема Add a definable row limit to 'View Data'
Дата
Msg-id HATEUR$2B6281AC0D499C0960564BEE4C932CA5@email.it
обсуждение исходный текст
Список pgadmin-hackers
The sub is in frmmain.


Private Sub mnuPopupViewData_Click()
On Error GoTo Err_Handler
svr.LogEvent "Entering " & App.Title & ":frmMain.mnuPopupViewData_Click()", etFullDebug
  
Dim objOutputForm As New frmSQLOutput
Dim rsQuery As New Recordset
Dim szTemp As String
Dim lLimit As Long
Dim lNumRow As Long
Const ROW_LIMIT_QUESTION As Long = 5000

  'count row
  lNumRow = 0
  StartMsg "Counting Records..."
  Set rsQuery = frmMain.svr.Databases(ctx.CurrentDB).Execute("SELECT count(*) AS count FROM " &
ctx.CurrentObject.FormattedID)
  If Not rsQuery.EOF Then lNumRow = rsQuery!Count
  EndMsg

  'Add a definable row limit to 'View Data'
  szTemp = InputBox("Insert row limit" & vbCrLf & "Table contain " & lNumRow & " rows", "Row limit", lNumRow)
  If Len(szTemp) = 0 Then Exit Sub
  lLimit = 0
  If IsNumeric(szTemp) Then lLimit = szTemp
  szTemp = "LIMIT " & lLimit
  
  If lLimit > ROW_LIMIT_QUESTION And lNumRow > 0 Then
    If MsgBox("The row limit is " & lLimit & ". The records which may take some time to load." & vbCrLf & "Do you wish
tocontinue?", vbQuestion + vbYesNo, "Continue?") = vbNo Then Exit Sub
 
  End If
  
  StartMsg "Executing SQL Query..."
  Set rsQuery = frmMain.svr.Databases(ctx.CurrentDB).Execute("SELECT * FROM " & ctx.CurrentObject.FormattedID &
szTemp)
  Load objOutputForm
  objOutputForm.Display rsQuery, ctx.CurrentDB, "(" & ctx.CurrentObject.ObjectType & ": " &
ctx.CurrentObject.FormattedID& ")"
 
  objOutputForm.Show
  EndMsg
  
  Exit Sub
  
Err_Handler:
  EndMsg
  If Err.Number <> 0 Then LogError Err.Number, Err.Description, App.Title & ":frmMain.mnuPopupViewData_Click"
End Sub



Bye !!
Frank Lupo (Wolf) !!

    /\_ _/\
    \ o o /
--ooo-----ooo---



--
Prendi GRATIS l'email universale che... risparmia: http://www.email.it/f

Sponsor:
Il lavandino che gocciola ti fa innervosire? L'idraulico che ti serve
lo trovi su QxService! Clicca qui ed il tuo problema sarà risolto!!
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=840&d=24-2


В списке pgadmin-hackers по дате отправления:

Предыдущее
От: "frank_lupo"
Дата:
Сообщение: patch tooltip
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: module patch