Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impact of Restructuring Tables on Queries

Status
Not open for further replies.

bobsmallwood

Programmer
Aug 9, 2001
38
0
0
US
Whenever a field is deleted from a table (or its name changed) one gets a "field not found in table" when a qery that has that field checked is attempted. The query cannot even be opened in design mode so as to de-select the no longer existing field. Is there a way to easily find out all the queries that use a specific field before a table is restructured? Are there any other tricks or rules-of-thumb to employ in this situation?
 
You can open .qbe files with a text editor (notepad, for instance) and make modifications. Then just save.

That I am aware there is no tool for locating .qbe files with specific fields in them.

You could build one in OPAL, however. Read into an array with textstream, and look at each array element for the field name. You could go further by breaking on '|', which is the field separator for .qbe files. You'd still have to do a search() for the field name, unless you also strip spaces.


Tony McGuire
"It's not about having enough time. It's about priorities.
 
The below is a pretty rudimentary version of what I addressed about creating your own. You'll need to point the filesystem at the directory/alias where you want to locate qbe files containing the table and field you are interested in.

Code:
method run(var eventInfo Event)
var
  ts      textstream
  fs      filesystem
  arFile,
  arFind  array[] string
endvar

if fs.findfirst("*.qbe") then
  fs.enumfilelist("*.qbe",arFile)
else
  return
endif

for x from 1 to arFile.size()
  ts.open(arFile[x],"r")
  ts.readline(arFind)
  ts.close()

;  arFind.view()
  ignorecaseinstringcompares(Yes)
  for i from 1 to arFind.size()
    if (arFind[i].search("export2")>0 and arFind[i].search("dom")>0) then
      arFind[i].view(arFile[x])
    endif
  endfor
  arFind.empty()
endfor
endMethod


Tony McGuire
"It's not about having enough time. It's about priorities.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top