Hi Gary.
>Using SDT 5e and tried the copy table/view from the database explorer. Found that if I have a view selected in the treeview window I still get the copy table to window asking me to navigate to a new table locations.
SDT wants to know the name of the new view to create. However, I admit it's kind of confusing because it's using a New Table dialog. I've changed the code near the beginning of the CopyTable method of SDT.SCX as follows to bring up a dialog specifically for views:
* If the new name wasn't passed, ask the user for one.
do case
case empty(tcNew) and tcType = ccVIEW
do form NewView to lcFileName
lcTable = lcFileName
case empty(tcNew) or ;
(.oUtility.JustPath(tcDBC) = .oUtility.JustPath(.cDBC) and ;
tcType = ccTABLE)
lcFileName = .GetNewFile()
lcTable = .oUtility.JustStem(lcFileName)
* The name was passed, so get the full path for it.
otherwise
lcFileName = fullpath(.oUtility.JustFName(tcNew), .cDBC)
lcTable = tcTable
endcase
(Most of this code is unchanged except for the first several lines and the fact that it's in a CASE statement now).
However, in testing this, I discovered a bug: CopyTable is called both for copying a view between databases and copying a view within a particular database. While it works fine for the former, the bug is that in the latter case it uses the wrong name for the view it creates. I changed the code in this routine as follows (at about line 173):
if tcDBC <> lcDBC
set database to (lcDBC)
create sql view (tcTable) &lcRemote &lcConnect as &lcSQL
else
create sql view (lcTable) &lcRemote &lcConnect as &lcSQL
endif tcDBC <> lcDBC
This forces it to use the new name you specified.
>Great product by the way!!!
Thanks!
Doug
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