Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CABuilder Mark McCassland please read
Message
From
15/03/2004 23:40:54
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
CABuilder Mark McCassland please read
Miscellaneous
Thread ID:
00886585
Message ID:
00886585
Views:
43
What can I say - your builder has saved me hours and hours of typing not to say debugging the errors this would have led to. Thanks a million.

Just a note, that I have had the need to use SQLServer Views because the original database I was working with was NOT normalised. The new tables converted from Fox to SQLServer were normalised but not wanting to throw out all the old code, we decided to use the new SQLViews of SQLServer2000 to produce tables structured like the old system. This works quite well, except that your builder only does tables, not views. So I modified it to include a second call, passing a parameter :

PROCEDURE Build
LOCAL llRetVal
llRetVal = THIS.BuildAdapters("TABLE")
llRetVal = THIS.BuildAdapters("VIEW")


*Procedure BuildAdapters accepts the parameter and passes it on

PROTECTED PROCEDURE BuildAdapters
LPARAMETERS tcType
IF (NOT THIS.Cr8_Connection()) OR THIS.lError
RETURN .f.
ENDIF
IF (NOT THIS.Cr8_BaseClassCode()) OR THIS.lError
RETURN .f.
ENDIF
IF (NOT THIS.GetTables(tcType)) OR THIS.lError
RETURN .f.
ENDIF

*Procedure GetTables modified as below:

PROTECTED PROCEDURE GetTables
LPARAMETERS tcTabletype
IF THIS.cConnectType = [NATIVE]
LOCAL llRetVal
llRetVal = THIS.GetNativeTables()
RETURN llRetVal
ENDIF
LOCAL lnRetVal, lcID
lnRetVal = SQLTABLES(THIS.nConnectHandle, tcTabletype, [crsTables])
IF lnRetVal < 0 OR NOT USED('crsTables')
THIS.SetError([Error retrieving list of ]+tcTabletype+[s from the database.])
RETURN .F.
ENDIF
lcID = THIS.cUserID
SELECT crsTables
IF THIS.lOracle
SET FILTER TO Table_Owner = '&lcID'
ELSE
SET FILTER TO NOT ALLTRIM(LOWER(Table_Name)) == [dtproperties]
ENDIF
LOCATE
IF EOF('crsTables')
THIS.SetError([No ]+tcTabletype+[s found for specified User/Database.])
RETURN .F.
ENDIF
ENDPROC

Everything went well and the builder made short work of the tables & Views. I then added my framework specific code to the _base class and off we were. You might want to include these above "improvements" with maybe a checkbox on the front end. I havent done this change as I hate having to edit a form non visually. I prefer the SCX to the PRG.

Thanks again
Next
Reply
Map
View

Click here to load this message in the networking platform