StrataFrame Forum

Using Visual FoxPro free table in Combination with SQL Server Database

http://forum.strataframe.net/Topic19434.aspx

By Elio Reyes - 9/16/2008



I see the VFPStandAloneTable sample, I hope does everything this sample has, but my program does not work.



I have more table from different folder that I have to incorporate in the project but when my first.



Thanks SF
By Ivan George Borges - 9/16/2008

Hey Pedro.

Lets start checking your Data Source setting. In the AppMain.vb, you will find a "SetDataSources" sub. In there, you should manyally set your datasource for your free tables. Something like:

DataLayer.DataSources.Add(New VfpDataSourceItem("MyFreeTables", "Provider=vfpoledb.1;Data Source="C:\MyFolderWhereMyFreeTablesAre";Collating Sequence=general;"))

And if I understood what you said, you might have tables in different folders, so you could create differente datasource keys for each, and then map your BOs accordingly:

DataLayer.DataSources.Add(New VfpDataSourceItem("MyFreeTables2", "Provider=vfpoledb.1;Data Source="C:\MyOtherFolderWhereMyFreeTablesAre";Collating Sequence=general;"))

 

By Ivan George Borges - 9/16/2008

And in your BOs properties sheet, don't forget to set the DataSourceKey too:

By Elio Reyes - 9/16/2008

Well, now I have this error "An error occurred while creating a new DataLayer for the business object."



Thanks SF
By Ivan George Borges - 9/16/2008

Could you give us some more details?

A stack trace. Your DataLayer.DataSources.Add line also could help.

By Elio Reyes - 9/16/2008

Not... Thanks was my problem, I moved the sentence ConnectionManager.SetConnections() before create the DataLayer.



All is working fine ...



You Are Right... Like ever



Thanks very very Much SF
By Ivan George Borges - 9/16/2008

You Are Right... Like ever

Well, and you are completely wrong on this. BigGrin

But glad you got it working! Cool