Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query VFP cursor and SQL server table
Message
De
27/02/2004 11:08:02
Suhas Hegde
Dental Surgeon
Sirsi, Inde
 
 
À
27/02/2004 10:54:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00881433
Message ID:
00881499
Vues:
26
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform