StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
Database on a Web Server and One Locally - BO Reads Wrong Table
Database on a Web Server and One Locally - BO Reads Wrong Table
Post Reply
Like
0
Database on a Web Server and One Locally - BO Reads Wrong Table
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Terry Bottorff
Terry Bottorff
posted 15 Years Ago
ANSWER
Topic Details
Share Topic
Group: Forum Members
Posts: 448,
Visits: 12K
I created a project that has a single form. I added a 2 projects that are BO Libs and one of the projects I added BO's attached to the web server database and the other project I added BO's attached to the local database. The databases have different names but the tables have identical names. I know that one of the tables on the web database is completely empty and has 100+ records locally. I use the BO assigned to the local database and simply try a me.filldatatable("Select * from bbresults") in the BO. I get no records which looks like to me it has read the table on the web server.
Is there a way to change the select to say "Select * from localdatatabase.bbresults" to force it to use the correct connection? I tried it but it said 'Invalid object name ' so maybe it is just a syntax problem. I know I have read on the forum that you can use multiple databases but I could not find how to make sure you get or save to the correct tables when they are named the exact same.
TIA.
Reply
Like
0
Replies
Edhy Rijo
E
Edhy Rijo
posted 15 Years Ago
ANSWER
Post Details
Share Post
E
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
Hi Terry,
Following Ivan's reply, look at the "Connecting to Data" in the help file for more detail explanation.
Basically you have to add a datasource item for your web server connection and add a DataSourceKey, then in you BO you manually enter the DataSourceKey used, so the BO will know which connection to use.
By default SF datasources does not have any key which is why we don't need modify the connection, but having this flexibility allows any SF application to simultaneously connect to different databases hosted on different servers or locations.
Edhy Rijo
Reply
Like
0
Terry Bottorff
Terry Bottorff
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 448,
Visits: 12K
Thank you both. With both of your help I was able to get it working the way it should. I had read this line in the documentation 20 times but I always stopped where it says 'left alone' because I thought that is what it meant. I did not read the last part about why you would not want to leave it alone.
from the AddRequiredDatasourceItem documentation:
The first parameter needs to be left alone ("") because the DataSourceKey property on our business object (CustomersBO) is "".
Thanks again.......
Reply
Like
0
Ivan George Borges
Ivan George Borges
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
Glad you got it going, Terry!
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
Database on a Web Server and One Locally - BO Reads Wrong Table
Terry Bottorff
-
15 Years Ago
Hi Terry. Have you configured different DataSourceKeys for the...
Ivan George Borges
-
15 Years Ago
Hi Terry,
Following Ivan's reply, look at the "Connecting...
Edhy Rijo
-
15 Years Ago
Thank you both. With both of your help I was able to get it working...
Terry Bottorff
-
15 Years Ago
Glad you got it going, Terry! ;)
Ivan George Borges
-
15 Years Ago
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search