Skip site navigation (1) Skip section navigation (2)

Re: Add a definable row limit to 'View Data'

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "frank_lupo" <frank_lupo(at)email(dot)it>,"pgadmin-hackers" <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Add a definable row limit to 'View Data'
Date: 2003-02-26 17:07:44
Message-ID: 03AF4E498C591348A42FC93DEA9661B8259CCE@mail.vale-housing.co.uk (view raw or flat)
Thread:
Lists: pgadmin-hackers
Hi Frank,

I'm not sure this is the best way to do this. How about a preset option in frmOptions for the number of rows. Then when the query is run, we say:

The query returned more than XXX rows. Do you wish to LIMIT the output?

Yes/No/Cancel

Yes = Limit
No = Return all rows
Cancel = Abort

What do you think?

Regards, Dave.



> -----Original Message-----
> From: frank_lupo [mailto:frank_lupo(at)email(dot)it] 
> Sent: 24 February 2003 13:30
> To: pgadmin-hackers
> Subject: [pgadmin-hackers] Add a definable row limit to 'View Data'
> 
> 
> 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

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

pgadmin-hackers by date

Next:From: Dave PageDate: 2003-02-26 17:17:50
Subject: Re: idea for schema object
Previous:From: frank_lupoDate: 2003-02-26 17:06:45
Subject: idea for schema object

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group