I have managed to screw up the installation. Now I got the error message ‘Cannot open database…login failed’
I have tried to reinstall SambaPOS but still no result. Do I need to clear any registry or delete any folders to make this work?
I have managed to screw up the installation. Now I got the error message ‘Cannot open database…login failed’
I have tried to reinstall SambaPOS but still no result. Do I need to clear any registry or delete any folders to make this work?
screen capture of the error message would be useful.
You can try removing the SambaSettings.txt file from C:\ProgramData\SAMBAPOS\SambaPOS4.
if that does Not work you try following, not sure if your issue is same…
Important: make sure up back up your database file first.
Screenshots and an explanation of what you did before the issue may help.
Hi @JohnS
I have used the first installation with Local DB and make changes with the sample data. Then I was thinking to start a new fresh install without sample data to test with the SQL Express. So I reinstalled SambaPOS but realized that the old config was there, so I tried to delete the sdf files. So now what I got is this error message when I start the app
and below is the stack trace:
[Exception Info 1]
Top-level Exception
Type: System.Data.SqlClient.SqlException
Message: Cannot open database “SambaPOS4” requested by the login. The login failed.
Login failed for user ‘user-PC\user’.
Source: .Net SqlClient Data Provider
Stack Trace: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.Open() at FluentMigrator.Runner.Processors.GenericProcessorBase.EnsureConnectionIsOpen() at FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.Exists(String template, Object[] args) at FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.SchemaExists(String schemaName) at FluentMigrator.Runner.VersionLoader.get_AlreadyCreatedVersionSchema() at FluentMigrator.Runner.VersionLoader.LoadVersionInfo() at FluentMigrator.Runner.VersionLoader..ctor(IMigrationRunner runner, Assembly assembly, IMigrationConventions conventions) at FluentMigrator.Runner.MigrationRunner..ctor(Assembly assembly, IRunnerContext runnerContext, IMigrationProcessor processor) at FluentMigrator.Runner.Initialization.TaskExecutor.Initialize() at FluentMigrator.Runner.Initialization.TaskExecutor.Execute() at Samba.Persistance.Data.Migrator.DoMigrate(String connectionString) at Samba.Persistance.Data.Migrator.DoMigrate(CommonDbContext context) at Samba.Persistance.Data.Initializer.Migrate(CommonDbContext context) at Samba.Persistance.Data.Initializer.InitializeDatabase(DataContext context) at System.Data.Entity.Database.<>c__DisplayClass2
1.b__0(DbContext c)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClass8.b__6()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.LazyInternalContext.b__4(InternalContext c)
at System.Data.Entity.Internal.RetryAction1.PerformAction(TInput input) at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action
1 action)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet1.Initialize() at System.Data.Entity.Internal.Linq.InternalSet
1.get_InternalContext()
at System.Data.Entity.Infrastructure.DbQuery1.System.Linq.IQueryable.get_Provider() at System.Linq.Queryable.Count[TSource](IQueryable
1 source)
at Samba.Infrastructure.Data.SqlData.EFWorkspace.CountT
at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.ShouldCreateData()
at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.CreateData()
at Samba.Presentation.Bootstrapper.InitializeShell()
Go to here - C:\ProgramData\SambaPOS\SambaPOS4
and find SambaSettings.txt
and delete.
Reinstall SambaPOS.
PS - If you want to use the new Local DB files, uninstall Compact SQL first, or when SambaPOS loads, change your Connection String to SambaPOS4.mdf
to use the Local DB.
I followed the instructions. But still not working. Still got the same error message.
BTW, do i need to choose Local DB during the installation?
can you delete the SambaPOS4 folder under My Documents for all the Windows user accounts and then re-install. i had similar issue and only way to get to to work was to delete all SambaPOS4 folder.
Are you logging into windows as an Administrator or Restricted User account ?
I logged in as an administrator
I did delete those folders. still the same. I am now lost
Uninstall SambaPOS.
Then delete all of the following folders
C:\Users\{windows user}\Documents\SambaPOS4
C:\Program Files (x86)\SambaPOS4 or C:\Program Files\SambaPOS4
C:\ProgramData\SAMBAPOS
Also any SambaPOS (sdf, mdf) files in C:\Users\{windows user}
Reinstall SambaPOS
Thank you for the reply. I have resorted to another solution which is to create a new user and install SambaPOS. Maybe a script or the uninstall script from SambaPOS should have done this.