﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » How Change TableSchema Programatly ?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 02:36:15 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost27066.aspx</link><description>I believe Trent already has it on the list of Enhancements for our next BO Mapper update :). I'll confirm that with him and let you know once I have a more concrete idea of the ifs and whens.</description><pubDate>Mon, 03 May 2010 13:30:23 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost20997.aspx</link><description>&lt;br&gt;
HI&lt;br&gt;
&lt;br&gt;
I'm using a 3rd party database, in the database design they put Schema as a company and in my SF application I have to change depends to the company I going to work to, but I do when I fill the BO and it still using the TableSchema property made by the BO Build.&lt;br&gt;
&lt;br&gt;
Public Overrides ReadOnly Property TableSchema() As String&lt;br&gt;
        Get&lt;br&gt;
            Return "P_T_P"&lt;br&gt;
        End Get&lt;br&gt;
    End Property&lt;br&gt;
&lt;br&gt;
Any suggestions how to change this are welcome.&lt;br&gt;
&lt;br&gt;
Thanks SF&lt;br&gt;</description><pubDate>Mon, 03 May 2010 13:30:23 GMT</pubDate><dc:creator>Elio Reyes</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost27061.aspx</link><description>Thanks for looking!&amp;nbsp; Is this something you guys would consider changing?&amp;nbsp; Maybe make the base property&amp;nbsp;so it's&amp;nbsp;read/write,&amp;nbsp;doesn't have to be overridden&amp;nbsp;and set the default&amp;nbsp;value in the constructor?</description><pubDate>Mon, 03 May 2010 08:58:54 GMT</pubDate><dc:creator>Chris Diesel</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost27055.aspx</link><description>You're right, this does at present require the manual step of removing the table schema from the designer file whenever you build the BO mapper. Once it is removed, you can set the table schema as an overridable property on the BO itself (or the base BO) to handle it from there.</description><pubDate>Fri, 30 Apr 2010 15:27:51 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost27042.aspx</link><description>I know this is an old thread, but I have just come across&amp;nbsp;the need to override the TableSchema property too, but I'm confused.&amp;nbsp; How can I override this property in a base level class&amp;nbsp;when it's being overridden at a higher level in each business object's designer code?&amp;nbsp; Doesn't this just override my base class code then? :ermm:&amp;nbsp; Thanks!</description><pubDate>Fri, 30 Apr 2010 09:13:18 GMT</pubDate><dc:creator>Chris Diesel</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost21039.aspx</link><description>Perdo,&lt;br&gt;
&lt;br&gt;
I think they are suggesting that in your BaseBO (if you aren't using one, now would be the time), you override the TableSchema property. Within it, you would then code the logic to change the db schema based on company. You could go about getting the company within the TaleSchema property in a number of ways.  You would also add a company property to the BaseBO, or you could have a shared class that provide the current company info...I'm sure there are other ways too.  Does that make more sense?</description><pubDate>Fri, 05 Dec 2008 07:53:21 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost21038.aspx</link><description>Excellent information, I know that I asking so much, I have VB concept problem, because I need to change the Schema in runtime, I was thinking in a global variable, but I don’t know how to this, is the way that I found to change the schema when the user change the company running the application.&lt;br&gt;
&lt;br&gt;
Any suggestion is appreciate&lt;br&gt;
&lt;br&gt;
Thanks a Lot for your time and your very important information&lt;br&gt;
&lt;br&gt;
 SF&lt;br&gt;</description><pubDate>Fri, 05 Dec 2008 07:36:52 GMT</pubDate><dc:creator>Elio Reyes</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost21029.aspx</link><description>[quote][b]Pedro Hernández (12/04/2008)[/b][hr]Hi &lt;BR&gt;&lt;BR&gt;I'm sorry for my bad exexplanations&lt;BR&gt;&lt;BR&gt;my problem is with SF internals instructions like save(), BrowseDialog..... because I can't tell then wichwhichema use, And of course they use the one when I make with the Business Object Mapper.[/quote]&lt;P&gt;Your explanations are OK, but it looks like you are not reading the replies properly :hehe:, the answer is right there for you, by working with the TableSchema property.</description><pubDate>Thu, 04 Dec 2008 10:24:01 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost21028.aspx</link><description>Hi &lt;br&gt;
&lt;br&gt;
I'm sorry for my bad exexplanations&lt;br&gt;
&lt;br&gt;
I fill the Bo's nice, because I send then a parameter with the Schema, my problem is with SF internals instructions like save(), BrowseDialog..... because I can't tell then wichwhichema use, And of course they use the one when I make with the Business Object Mapper.&lt;br&gt;
&lt;br&gt;
I need to change this too.&lt;br&gt;
&lt;br&gt;
Thanks SF</description><pubDate>Thu, 04 Dec 2008 10:20:19 GMT</pubDate><dc:creator>Elio Reyes</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost21024.aspx</link><description>[code][/code][quote][b]Pedro Hernández (12/04/2008)[/b][hr]Sorry it works, the problem is when I save usisng the save method bo.save()[/quote]&lt;P&gt;Pedro,&lt;/P&gt;&lt;P&gt;Probably there are some methods in SF which will use the TableSchema property of the BO, and in your code you are not updating this property, then it will return the schema of the table which was selected at the time of the BO generation by the BOM.&lt;/P&gt;&lt;P&gt;Like I said before, in your base BO&amp;nbsp;class, simply override that property to return the value of your custom schema, something like this:&lt;/P&gt;&lt;P&gt;[codesnippet][code]&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;P&gt;Public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Overridable&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;ReadOnly&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; TableSchema()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; GetCustomSchemaName()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; GetCustomSchemaName() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'-- Add your logic here to return your Schema Name from your source.&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"Your Schema Name"&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;[/code][/codesnippet]&lt;/P&gt;&lt;P&gt;Or if you want to make is simpler, don't create the GetCustomSchemaName() function and add that logic in the "Get" of the TableSchema property.&amp;nbsp; If you don't have a base BO, then you will need to do the same for all the BO you create, so it is&amp;nbsp;a best practice to have your own base BO class.&lt;/P&gt;&lt;P&gt;And in your Fill command try to use the propertys of the BO available to you like the TableSchema, so your method may look like this:&lt;/P&gt;&lt;P&gt;[codesnippet][code]&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; FillAll()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.FillDataTable(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"SELECT * FROM "&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &amp;amp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.TableSchema &amp;amp; &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;".OP_OPER_DET_MO WHERE ORDEN_PRODUCCION IN "&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &amp;amp; _&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;" (SELECT ORDEN_PRODUCCION FROM "&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &amp;amp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.TableSchema &amp;amp; &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;".ORDEN_PRODUCCION WHERE ESTADO='L' ) AND OPERACION = 'GALERA' ORDER BY ORDEN_PRODUCCION"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;[/code][/codesnippet]&lt;/P&gt;&lt;P&gt;Of course, I have not try the above, it is mean to give you an idea to explore.</description><pubDate>Thu, 04 Dec 2008 10:08:39 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost21018.aspx</link><description>Well, if you are going to take a base level approach, then you need to create a BaseBO that all of your BOs inherit from instead of directly inheriting from BusinessLayer.&amp;nbsp; Then you could implement core base logic to redirect the table schema.&amp;nbsp; Since I don't really know what you are trying to do, I can't give you a straight answer here.&amp;nbsp; You are talking about a 3rd party database.&amp;nbsp; So are you creating your own DbDataSourceItem or trying to make an existing one work?&amp;nbsp; If you are trying to talk to a 3rd party database then I would recommend creating your own DbDataSourceItem that has all of the this logic within it.&amp;nbsp; If the logic for this database is closest to SqlServer, the copy over the SqlDataSOurceItem class and start from there.&amp;nbsp; If it is closest to OLEDB the copy over the Vfp ro AccessDataSourceItem and do the same.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I really don't have enough information to give you any direct answers, but maybe some of these ideas will get you going in the right direction depending upon your needs.</description><pubDate>Thu, 04 Dec 2008 09:30:44 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost21013.aspx</link><description>Sorry it works, the problem is when I save usisng the save method bo.save()</description><pubDate>Thu, 04 Dec 2008 08:53:48 GMT</pubDate><dc:creator>Elio Reyes</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost21012.aspx</link><description>I have the information in a table, how can I OverWrite the all BO Methods with the information in my table, because a do something :&lt;br&gt;
&lt;br&gt;
[quote]Public Sub FillAll(ByVal cTableSchema As String)&lt;br&gt;
&lt;br&gt;
        Me.FillDataTable("SELECT * FROM " &amp; cTableSchema &amp; ".OP_OPER_DET_MO WHERE ORDEN_PRODUCCION IN " &amp; _&lt;br&gt;
                         " (SELECT ORDEN_PRODUCCION FROM  " &amp; cTableSchema &amp; ".ORDEN_PRODUCCION WHERE ESTADO='L' ) AND OPERACION = 'GALERA' ORDER BY ORDEN_PRODUCCION")&lt;br&gt;
End Sub  [/quote]&lt;br&gt;
&lt;br&gt;
I send to all my filldata the schema, but it does not work.&lt;br&gt;
&lt;br&gt;
If you can show me how to averwrite&lt;br&gt;
&lt;br&gt;
Thanks SF</description><pubDate>Thu, 04 Dec 2008 08:21:59 GMT</pubDate><dc:creator>Elio Reyes</dc:creator></item><item><title>RE: How Change TableSchema Programatly ?</title><link>http://forum.strataframe.net/FindPost20999.aspx</link><description>Hi Pedro,&lt;P&gt;If you are using a base BO you can overwrite the TableSchema property and use whatever schema you want in that method.&amp;nbsp; I guess you will have the company information somewhere which will be used as the schema.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Also make sure that any custom FillBy method you create, uses the BO.TableNameAndSchema property.&amp;nbsp; I have a method I use in all my BOs to get all Records like this:&lt;/P&gt;&lt;P&gt;[codesnippet][code]&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;P&gt;Public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; FillAllRecords()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; cmd &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; SqlCommand()&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;cmd.CommandText = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Format(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"Select * From {0}"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;STRONG&gt;Me&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;STRONG&gt;.TableNameAndSchema&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.FillDataTable(cmd)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Using&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;[/code][/codesnippet]</description><pubDate>Wed, 03 Dec 2008 16:21:33 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>