Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: LAFFDB binary indexing
while @true linenumber = dbfindrecord(...search criteria...) if linenumber = -1 then break dbgetentirerecord(...details of the record...) gosub Deal_with_the_record endwhile
Addextender("LAFFD34i.DLL") db_fn = "Security log dump file.log" db_create = 0 ; file should exist db_model = 2 ; traditional db_cols = 0 ; use the number of columns in the first line of the file db_format = 0 ; delimiter based db_delimiter = @tab db_options = "" ; don't bother hnd_db = dbopen(db_fn,db_create,db_model,db_cols,db_format,db_delimit,db_option) db_colcount = dbgetcolumncount(hnd_db) for a = 1 to db_colcount dbbindcol(hnd_db,a,VAR%a%) next search_flags = 1 + 4 ; use and return fixed record nums (note that fixed record nums are 1 based), and search forward search_col = 5 ; this is the column you wanted to skim search_value = curtain_number ; this is what you wanted to search for search_case = 0 ; not case sensitive search_start = 0 ; start at zero to actually search record #1 get_flags = 1 ; get a fixed record num (needs to match search flag) linenumber = search_start ; need to init the variable while @true linenumber = dbfindrecord(hnd_db,linenumber,search_flags,search_col,search_value,search_case)) ;returns -1 if no more matches if linenumber < 0 then break ; breaks on done searching OR error (because error is -42424242) dbgetentirerecord(hnd_db,linenumber,get_flags) gosub Deal_with_the_record endwhile dbclose(hnd_db) exit ;--------------------------------------------------------------------------------------------------------- :Deal_with_the_record ; here is where you will do whatever you want.. ; the variables will be named var1, var2, var3, var4... etc ; this routine will run once for each matching line in your file ; have at it... return ;---------------------------------------------------------------------------------------------------------
Article ID: W15056
File Created: 2002:09:05:13:49:22
Last Updated: 2002:09:05:13:49:22