Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Jim:
in my main .prg , i hv a function to open all the DB which needed.
i use the command "use DBname exclusive in 0" to open all these DB.
both the form.init contain the similar code:
WITH THISFORM.DATAENVIRONMENT
.ADDOBJECT('CURSOR1','Cursor')
.CURSOR1.CURSORSOURCE = DBF_path + 'DB'
.CURSOR1.ALIAS = 'DB'
.CURSOR1.EXCLUSIVE = .T.
ENDWITH
SELECT DB
WITH THISFORM.GRID
.RECORDSOURCE = 'DB'
.COLUMNCOUNT = 6
FOR I = 1 TO 6
.COLUMNS[I].FORECOLOR = RGB(0,0,0)
.COLUMNS[i].REMOVEOBJECT('Text1')
.COLUMNS[i].ADDOBJECT('Text1','Textbox')
.COLUMNS[i].HEADER1.CAPTION = GRD_INFO[I,1]
.COLUMNS[i].HEADER1.ALIGNMENT = 0
.COLUMNS[i].CONTROLSOURCE = GRD_INFO[I,2]
.COLUMNS[i].VISIBLE = .T.
.COLUMNS[i].SPARSE = .T.
ENDFOR
ENDWITH
*GRD_INFO contain field name and field header for display
my delete command button.click:
SELECT DB
GO TOP
LOCATE FOR ALLTRIM(unique_no) = ALLTRIM(DB.unique_no)
DO WHILE FOUND()
DO WHILE RLOCK() = .T.
DELETE
CONTINUE
UNLOCK
EXIT
ENDDO
ENDDO
WAIT WINDOW "Deleting......." TIMEOUT 3
PACK
every time when i click the button , both the grid in seprated form display blank,is there another method to do the delete function?!
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement