>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
Shouldn't the last conditional block be: if tcDBC<>lcDBC ? Also a very minor clarification: the copyTable method is part of the form fmrSDT not in the SDT.VCX.
If I make these changes (I did and it works fine), will I need to remove them to apply any future posted updates to 5E from your update page at
www.stonefield.com?Thanks for the quick response.
Gary
Helping Make Ideas Reality