|
Group: StrataFrame Users
Posts: 430,
Visits: 507
|
I have a Maintenace form setup, select add and populate my fields. The fields populate ok I then select Save data, but a Strataframe error message apperas, .... Cannot Open database "MyDataBase" requested by the login. I have not specisied a Login screen anywhere and cant remeber setting up a database called MyDatabase ...
|
|
Group: StrataFrame Users
Posts: 430,
Visits: 507
|
The only rferance to MyDatabase in the main program is commented out: Below is acopy of Proram.cs using MicroFour.StrataFrame.Application;using MicroFour.StrataFrame.Data;using System;using System.Collections.Generic;using System.Windows.Forms;namespace StratFarmeSmaApp{ static class Program{ /// <summary>/// The main entry point for the application./// </summary>[ STAThread]static void Main(){ //-- Enable visual styles on the applicationApplication.EnableVisualStyles();//-- Add event handlers for the application eventsStrataFrameApplication.ShowGateway +=new StrataFrameApplication.ShowGatewayEventHandler(ShowGateway); StrataFrameApplication.InitializingApplication +=new StrataFrameApplication.InitializingApplicationEventHandler(InitApplication); StrataFrameApplication.SetDataSources +=new StrataFrameApplication.SetDataSourcesEventHandler(SetDataSources); StrataFrameApplication.UnhandledExceptionFound +=new StrataFrameApplication.UnhandledExceptionFoundEventHandler(UnhandledExceptionFound); StrataFrameApplication.ShowLoginAndInitializeForm +=new StrataFrameApplication.ShowLoginAndInitializeFormEventHandler(ShowLoginAndInitMainForm); //-- Run the applicationStrataFrameApplication.RunApplication();} /// <summary>/// Gets the connection string if the application will use a custom method to aquire the connection/// string rather than the StrataFrame Connection String Manager (optional)/// </summary>/// <remarks></remarks>private static void SetDataSources(){ // ToDo: 1) Set the connection information below including the connection application settings and the// required settings information and then call the ConnectionManager's SetConnections() method.//// OR//// 2) Manually set the DataSourceItems on the DataSources collection below.ConnectionManager.AddRequiredDataSourceItem("", "Visual Fox Pro Connection", DataSourceTypeOptions.VisualFoxPro, @"C:\KERDEMO\DFS.dbc", "This connection is used by YourApp.");// -- You can set as many data sources as necessary. The business objects use the data source specified// by their DataSourceKey property (defaults to "").//------------------------------------// Using the Connection Manager//------------------------------------//-- Set the information specific to this application and the data sources// The application key:ConnectionManager.ApplicationKey = "StratFarmeSmaApp";ConnectionManager.ApplicationDefaultTitle = "StratFarmeSmaApp Connection";ConnectionManager.ApplicationDefaultDescription = "This application connection is used by StratFarmeSmaApp";//-- Set the required data source information so that the ConnectionManager can gather it// SQL Connection// ConnectionManager.AddRequiredDataSourceItem("", "SQL Connection",// DataSourceTypeOptions.SqlServer, "MyDatabase", "This connection is used by StratFarmeSmaApp.");// Oracle Connection//ConnectionManager.AddRequiredDataSourceItem("", "Oracle Connection", // DataSourceTypeOptions.Oracle, "", "This connection is used by StratFarmeSmaApp.");// Access Connection//ConnectionManager.AddRequiredDataSourceItem("", "Access Connection", // DataSourceTypeOptions.MicrosoftAccess, "", "This connection is used by StratFarmeSmaApp.");// FoxPro Connection//ConnectionManager.AddRequiredDataSourceItem("", "Visual Fox Pro Connection", // DataSourceTypeOptions.VisualFoxPro, "", "This connection is used by StratFarmeSmaApp.");//-- Make the call to SetConnections which will gather the connection information, show the connection wizard// if needed and set the DataSources collection on the DataLayer class.ConnectionManager.SetConnections();//------------------------------------// Setting the data sources manually//------------------------------------//-- SQL Server//DataLayer.DataSources.Add(new SqlDataSourceItem("", "myconnectionstring"));//-- Oracle//DataLayer.DataSources.Add(new OracleDataSourceItem("", "myconnectionstring"));//-- Microsoft Access//DataLayer.DataSources.Add(new AccessDataSourceItem("", "myconnectionstring"));//-- Visual Fox Pro//DataLayer.DataSources.Add(new VfpDataSourceItem("", "myconnectionstring"));} /// <summary>/// Shows the "Gateway" form (a custom form that gives the user a choice to launch different components/// within the application) (optional)/// </summary>/// <param name="e"></param>/// <remarks></remarks>private static void ShowGateway(ShowGatewayEventArgs e){ //-- Inform the application to not show the "Gateway" form again after the main form has closede.ShowGatewayAfterMainFormClose = false;} /// <summary>/// Shows a login form before a main form is shown and allows security to be checked before the application/// launches the main form (optional)/// </summary>/// <param name="e"></param>/// <remarks></remarks>private static void ShowLoginAndInitMainForm(ShowLoginAndInitFormEventArgs e){ //-- ToDo: add any code to show a login form and authenticate the user// e.LoginSuccessful = ?} /// <summary>/// Provides a centralized location to add any initialization parameters that need to be set before/// the application is loaded and defines the form types used as main forms by the application/// </summary>/// <param name="e"></param>/// <remarks></remarks>private static void InitApplication(InitializingApplicationEventArgs e){ //-- Add the main form type//-- If more than one form is added to the collection, they can be chosen by showing a "Gateway" form// and supplying the index of the form to show (At least 1 form type must be added to the collectione.Forms.Add( typeof(StratFarmeSmaApp.Form2));//-- ToDo: Add any extra application initializationMicroFour.StrataFrame.UI. Localization.MessageKeyType = MicroFour.StrataFrame.Messaging.MessageKeyDataType.XML;MicroFour.StrataFrame.UI. Localization.MessageLocaleID = MicroFour.StrataFrame.UI.Localization.GetActiveLanguage("StratFarmeSmaApp", "", false); ;} /// <summary>/// Catches any unhandled exception within the application and provides a place to log the information/// </summary>/// <param name="e"></param>/// <remarks></remarks>private static void UnhandledExceptionFound(UnhandledExceptionFoundEventArgs e){ //-- ToDo: add any error logging required. To prevent the StrataFrame ApplicationErrorForm from showing,// set:// e.Handled = true} } }
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Are you trying to implement Security? You will have to give me more information to go off of as I have never even heard of this message outside of this context. Can you give me the stack trace and the inner exceptions? Thanks.
|