Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append Data
Message
From
13/07/2016 08:24:14
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Append Data
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01638312
Message ID:
01638312
Views:
58
Dear Professors,

I have these codes
cmd="select * from vouchers where vou_type='CR'and dr_amount>0 AND date=?f_date1 ORDER BY vou_no"
if sqlexec(con,cmd,'tab1')<0
	aerror(laerror)
	messagebox(laerror[1,2])
	return
endif

cmd="select * from cash_sum where vou_type='SC'and dr_amount>0  AND date=?f_date1 AND acc_code='2310001' ORDER BY vou_no"
if sqlexec(con,cmd,'tab2')<0
	aerror(laerror)
	messagebox(laerror[1,2])
	return
endif

cmd="select * from cashprp_sum where vou_type='PC'and CR_amount>0  AND date=?f_date1 ORDER BY vou_no"
if sqlexec(con,cmd,'tab3')<0
	aerror(laerror)
	messagebox(laerror[1,2])
	return
endif

cmd="select * from vouchers where vou_type='CP'and Cr_amount>0  AND date=?f_date1 ORDER BY vou_no"
if sqlexec(con,cmd,'tab4')<0
	aerror(laerror)
	messagebox(laerror[1,2])
	return
endif

create cursor chbook (vou_no n(10),date d(8),vou_type c(2),acc_code c(7),;
	acc_name c(40), dr_amount n(13,2),cr_amount n(13,2),qty n(10),balance n(13,2),;
	dr_cr c(3),code2 c(7),title2  c(60),list n(1),hello c(7 ),srno n(4),l n(1))

APPEND FROM DBF("tab1")
APPEND FROM DBF("tab2")
APPEND FROM DBF("tab3")
APPEND FROM DBF("tab4")
I collect data into 4 cursor and then append in 1 cursor.
is it possible to use append data directly from sqlserver table to cursor chbook.
I do not want to use sqlexec() 4 times.
Next
Reply
Map
View

Click here to load this message in the networking platform