General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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?!
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only