HELP!! Easy... Using recordset Seek() method???
Posted on 2001-09-07
I have a DBF file that I need to be able to open, search, and edit. Currently I just use a database object and recordset object and use the FindFirst method. However, I was instructed that there was a much more efficient way. I was instructed to create a tabledef object, create an index, open the recordset as Table-Type (dbopentable) and use the seek method. However, I cannot seem to get this to work. I was able to create the tabledef, and index (which actually creates an index file and places it in the directory of your application), but when I try to use the seek method, it tells me that the operation is not supported.
Here is the logic I am using. My DBF file is called "Structur.dbf" in case you are wondering.
Set dbDbfDatabase = gwsMsJetRepository.OpenDatabase(App.Path, False, False, "dBASE III;")
Set tbdDstru = dbDbfDatabase.TableDefs("Structur")
Set idxDstru = tbdDstru.CreateIndex("Z_GISID")
idxDstru.Fields = "Z_GISID"
Set recDstruRcds = dbDbfDatabase.OpenRecordset(strSql, , dbOpenTable)
recDstruRcds.Seek "=", "Z_GISID='24298'"