Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote Views versus SQL Pass through
Message
From
15/09/1998 12:45:48
Paul De Niverville
Deniverville Econometric Research Ltd.
Victoria, British Columbia, Canada
 
 
To
12/09/1998 23:41:58
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00134621
Message ID:
00136818
Views:
14
>>Hi Nabil,
>>If you want my code to update local lookup from MSSQL Server, let me know.
>>
>>Paul de Niverville
>
>Yes please

Hi Nabil,

* this is the click method of a command button that starts the download process.
* The user has already clicked a checkbox called chkClient_master.

open database pngmis && to get procedure build
set safety off

* The syntax for build_data
* do build_data with 'remote view name', 'local table name'

if thisform.chkClient_master.value = 1
* client.dbf is the local VFP lookup table
use client exclusive
zap
* the connection handle is 1.
x = sqlexec(1,'SELECT Client_master.PRMS, Client_master.LEGAL_NAME, '+;
'Client_master.ACTIVE_FLAG '+;
'FROM dbo.CLIENT_MASTER Client_master where client_master.active_flag = "Y"','client_master')
if x < 1
= messagebox('Problem with download of client master table. Stopping.',16)
return
endif

do build_data with 'client_master', 'client'
sele client_master
use && closes view
select client
* added the following line so that the list of upper and lower case client names
* doesn't screw up the pull down list company names.
replace all client.legal_name with upper(client.legal_name)
use && closes local table
endif


* procedure build_data is in the stored procedures for the database pngmis.
* I included it here to show you the code.

procedure build_data
parameter a,b
* do build_data with 'remote view name', 'local table name'
* a - foreign view
* b - local table
sele (a)
goto top
do while not eof()
scatter memo to arrayl
INSERT INTO (b) FROM array ARRAYl
skip 1
enddo
Previous
Reply
Map
View

Click here to load this message in the networking platform