Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query VFP cursor and SQL server table
Message
From
27/02/2004 11:08:02
Suhas Hegde
Dental Surgeon
Sirsi, India
 
 
To
27/02/2004 10:54:35
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00881433
Message ID:
00881499
Views:
25
let me more clear.
U may have to check for typo as this goes of the top of my head.
sqlexec(han,"select cus_id into #temp from customer where 1 = 0") && would create a temp table on the server which would be droped when the connection closes or u drop it.
** Now populate this table
sqlexec(han,"select * from #temp","temp")
** set biffering to table
cursorsetprop("buffering",5,"temp")
** now populate the temp table created on the sqlserver with the cus_id which u have.
select localcursor
scan
 insert into temp values(localcursor.cus_id)
endscan
*******make this updatable
cursorsetprop("tables","#temp","temp")
cursorsetprop("UpdateNameList","cus_id #temp.cus_id","temp")
cursorsetprop("UpdatableFieldList","cus_id","temp")
cursorsetprop("KeyFieldlist","cus_id","temp")
cursorsetprop("Sendupdates",.t.,"temp")
tableupdate(2,.t.,"temp")
** use inner join to retrive the recordset
sqlexec(han,"select customer.* from customer inner join "+;
             "#temp on customer.cus_id = #temp.cus_id","MYcursor")
sqlexec(han,"drop #temp") && drop the table
the MYcursor is populated with the records u want. also u can make the Mycursor updatable further use.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform