Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View Copy
Message
From
03/10/1997 17:22:54
 
 
To
03/10/1997 14:31:23
General information
Forum:
Visual FoxPro
Category:
Stonefield
Title:
Miscellaneous
Thread ID:
00053112
Message ID:
00053175
Views:
23
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform