From: | frank_lupo <frank_lupo(at)email(dot)it> |
---|---|
To: | pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org> |
Subject: | Add a definable row limit to 'View Data' |
Date: | 2003-02-24 13:30:27 |
Message-ID: | HATEUR$2B6281AC0D499C0960564BEE4C932CA5@email.it |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 to continue?", 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
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Page | 2003-02-26 16:52:05 | Re: module patch |
Previous Message | frank_lupo | 2003-02-24 11:01:52 | patch tooltip |