>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only