Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update VFP cursor with sqlserver table
Message
 
To
29/11/2017 01:37:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01655933
Message ID:
01655936
Views:
51
>Dear Experts
>
>I have following codes
>
>
>text TO cmd noshow
>select code,name
> from sale
>ENDTEXT
>
>if sqlexec(con,cmd,'table1')<0
>	aerror(laerror)
>	messagebox(laerror[1,2])
>	return
>endif
>
>
>table2="crs"+sys(2015)
>select * from table1 into cursor table2 readwrite
>
>
>Now I want to update table2.name with sqlserver table master like this
>
>
>update table2.name=master.name from master where table2.code=master.code
>
>
>how is it possible?
text TO cmd noshow
     select code,name
           from sale;

     select sale.code,Master.name
           from sale
     INNER JOIN Master ON sale.Code = Master.Code;
ENDTEXT

if sqlexec(con,cmd)<0
   aerror(laerror)
   messagebox(laerror[1,2])
   return
endif


table2="crs"+sys(2015)
select * from SQLRESULT into cursor (table2) readwrite

table3="crs"+sys(2015)
select * from SQLRESULT1 into cursor (table3) readwrite
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform