Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using SQL remote view
Message
De
31/10/2001 05:09:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/10/2001 22:10:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00575449
Message ID:
00575512
Vues:
30
>Hi,
>
>is it advisable that everytime you choose a specific item in a combobox, it will trigger a command that will create a sql remote view?
>
>The idea is that a pageframe that has 2 pages each contains a grid.
>
>everytime the user clicks item A, the active page is set to 1. If the use clicks on item B in the combobox, a filter form will pop up. The user will encode or select his/her desired filter conditions and upon clicking the ok button, the program will then activate page 2 of the pageframe and will proceed in creating SQL remote view named(dispatches) depending on the filter conditions the user selected?.
>
>Note: The grid in page2 has a recordsourcetype = alias and recordsource = dispatches
>
>
>Thanks in advance...

Mike,
What you say is doable. However views are part of a DBC, each new view would require a new unique name and probably you would drop after usage. Remote view's initial loading is slower and if you would change it per click it might be too much time consuming (once loaded however they might be faster depending on backend and version).
If you can't use one parametric view from the beginning and grid needs no update (though this could be made updatable too) there is a simplier way. Use SQL pass through cursors or ADO recordsets with Activex grids. ie: lcStatement is prepared by user selections and look like :
lcStatement = 'select * from pubs..titles where ...'
lnHandle=SQLStringConnect('DRIVER=SQL Server;SERVER=servername;DATABASE=pubs;UID=name;PWD=***')
with thisform.myPgf.myPage.myGrid
  .RecordSource = ''
  SQLExec(lnHandle,lcStatement,'myCursor')
  .RecordSource = 'myCursor'
endwith
SQLDisconnect(lnHandle)
You might make the connection and keep handle alive depending on your needs.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform