MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL
Go Back  Xtreme Visual Basic Talk > > > MSHFlexgrid sort issue on remote conn to SQL


Reply
 
Thread Tools Display Modes
  #1  
Old 03-15-2016, 01:09 AM
pizzaguy pizzaguy is offline
Regular
 
Join Date: Apr 2005
Posts: 54
Default MSHFlexgrid sort issue on remote conn to SQL


Weird, probably simple question to answer:

I have a flexgrid sort that works when app is connected to local sql server, but when conn remotely the sort no longer works?

TIA
Reply With Quote
  #2  
Old 03-17-2016, 02:55 AM
pizzaguy pizzaguy is offline
Regular
 
Join Date: Apr 2005
Posts: 54
Default

anyone?
Reply With Quote
  #3  
Old 03-17-2016, 05:35 AM
Flyguy's Avatar
FlyguyMSHFlexgrid sort issue on remote conn to SQL Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,164
Default

can you share some code?
Reply With Quote
  #4  
Old 03-17-2016, 11:29 AM
pizzaguy pizzaguy is offline
Regular
 
Join Date: Apr 2005
Posts: 54
Default

Yes, I'm sorry. Here you go:

Code:
Private Sub RefreshInvoiceMaster()

    Call FormatInvoiceMasterGrid
    
    Dim CN As ADODB.Connection, RS As ADODB.Recordset, sSQL As String
    Set CN = New ADODB.Connection: Set RS = New ADODB.Recordset
    CN.CursorLocation = adUseClient
    RS.CursorLocation = adUseClient
    
    CN.Open ConnStr
    
    sSQL = "Select * FROM InvoiceMaster;"
    
    Set RS = CN.Execute(sSQL)
    
    fgInvoiceMaster.Redraw = False: fgInvoiceMaster.Rows = 2: fgROW = 0
    
    Do While Not RS.EOF()
        fgROW = fgROW + 1
        fgInvoiceMaster.Rows = fgInvoiceMaster.Rows + 1
    
        For fgCOL = 0 To RS.Fields.Count - 1
            fgInvoiceMaster.TextMatrix(fgROW, fgCOL) = RS(fgCOL).Value
            If fgCOL = 1 Then fgInvoiceMaster.TextMatrix(fgROW, fgCOL) = "$" & Format(fgInvoiceMaster.TextMatrix(fgROW, fgCOL), "###,###.00")
        Next fgCOL
        
        RS.MoveNext
    Loop
    
    fgInvoiceMaster.ColSel = 0
    fgInvoiceMaster.Sort = flexSortStringDescending
    fgInvoiceMaster.Redraw = True
    
End Sub
Like I said, the sort works locally, but not when I connect remotely. I have tried with/without adUseClient.

Thanks.
Reply With Quote
  #5  
Old 03-17-2016, 04:42 PM
pizzaguy pizzaguy is offline
Regular
 
Join Date: Apr 2005
Posts: 54
Default

I fixed it by changing to the following for dates (which is what was not working):

Code:
                If RS(fgCOL).Type = adDBDate Then
                    .TextMatrix(fgROW, fgCOL) = Format(RS(fgCOL).Value, "yyyy-mm-dd")
                Else
                    .TextMatrix(fgROW, fgCOL) = RS(fgCOL).Value
                End If
Reply With Quote
Reply

Tags
conn, connected, local, sort, sql, remote, issue, mshflexgrid


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL
 
MSHFlexgrid sort issue on remote conn to SQL
MSHFlexgrid sort issue on remote conn to SQL
 
-->