Using MS server connection string issue

Hello guys,

Well its the first time i’m using MS server 2012 as a OS, ive taken the forum advice and trying to setup a proper server using server 2012 as an OS and I my setup is standalone with GUI, my problem is with connection to SAMBAPOS. The MSMS can connect correctly with Windows Authentication and with SQL authentication login using: username=sa & password=sambapos#1.

But when I use the same credential to log into the connection string for sambappos I cant seem to get a connection.

This version of Sambapos in hosted on the server so local host is accurate.

Any Ideas where I’m going wrong?



EDIT:
I noticed the sql service is in 32 bit but my server OS is 64 bit… I’m changing this now.

Change:

Data Source=localhost

To:

Data Source=SAMBAPOSSERVER\SAMBAPOS4

Then see the magic happens! :smile:

1 Like

Data Source=SAMBAPOSSERVER\SAMBAPOS4; User Id=sa Password=sambapos#1; Database=SAMBAPOS4;

does not work either.

I have done a clean MS server 2014 installation from the step by step guide by Kendash.

what i do miss is the actual database under the sql databases like I have seen on other screenshots. Here is mine:

Here is my original DB:

Is it missing because it is a new DB and nothing has been saved?

Data Source should be:

SAMBAPOSSERVER\SQLEXPRESS

This is shown in your SSMS screenshot in the first line of the Object Explorer. It should also be shown on the Connection dialog when you first start SSMS, where you click “connect”.

When SambaPOS successfully connects, it should create a Database for you, as specified by the Connection String.

Or if you have a DB backup, you can use SSMS to restore the DB first, then launch SambaPOS:

  • right-click on the Databases node in the Object Explorer, and select Restore Database …
  • choose Device, and browse to the location of the Backup (it should be a .bak file)
  • optionally change the name of the DB that will be restored/created
  • click Ok

Thank you for that last bit of info, I was wondering where it was…

Data Source=SAMBAPOSSERVER\SQLEXPRESS; User Id=sa Password=sambapos#1; Database=SAMBAPOS4;

does not work QMcKay… any other ideas?

You are missing a semi-colon after User Id …

Data Source=SAMBAPOSSERVER\SQLEXPRESS; User Id=sa; Password=sambapos#1; Database=SAMBAPOS4;

You deserve a kiss for those eagle like eyes of yours @QMcKay

works, thank you, also for Database advice .

1 Like

Some other DB Tips …

#Two ways to login, if you enabled “Mixed-mode Authentication”

Windows Authentication uses the Windows UserName(s) and Passwords from your computer(s).

SQL Server Authentication uses SQL UserName(s) and Passwords, which are stored within the SQL Server DB itself.

When setting up SambaPOS Multi-Terminal systems, it is far simpler to use SQL Authentication, because it bypasses credentials on the Windows OS.


#Enabling “Mixed-mode Authentication” after Installation, if you did not enable it when you ran the setup


#Changing the SQL Server “sa” account Password

The “sa” account is built-in and cannot be renamed, but you can change the password for the account.


#Adding another SQL Server User Login

For ease of setup in Multi-Terminal systems, we generally recommend using the “sa” account for all Terminals, but you may define other users for different Terminals or other purposes if you so choose.


#Restoring a Backup

You can backup and restore individual Databases using SSMS. When you use SSMS to restore a DB Backup, you also have the choice to rename the database, over-write (nearly) any DB within the Instance, or simply restore the backup using the original name contained in the Backup.

If you use the Edit Connection Button you don’t have to type your connection string manually. Handy to know for future.

1 Like

Yes @Jesse is correct. If you can get into SambaPOS in the first place, that dialog will created the proper connection string syntax.

But sometimes, in cases where you cannot get SambaPOS to run, you need to change the Connection String Manually in SambaSettings.txt

1 Like

What would be really useful @QMcKay is a Startup parameters such as “-connectstr” that automatically brings up the connection string dialogue box before attempting to attach the DB.

As you have described if the string has an error SambaPOS just hangs and you need to find the hidden file SambaSettings,txt and manually edit it which I think is not such a great idea. Using a Start parameter also will help switching DB’s for Testing and Development purposes.

1 Like

There is also this dialog that can appear, which forces a restart, but you edit the string in-place, click Ok, and the next time you start, it will attempt connection with the modified information …

1 Like

Awesome I tried it all, I unfortunately get a error msg when I follow you database back up step by step.

Tried renaming DB and just leaving as is, both with errors. Do you know what it wants?

Also why cant I restore from ZIP in Sambapos Settings?

OK got it working will post resolve in a bit

Restore of database ‘SambaPOS4’ failed.

The backup set holds a backup of a database other than the existing ‘SambaPOS4’ database.

The error you are getting during restore of DB with SSMS can be overcome if you look at the Options portion of the Restore dialog, and check these boxes (the first box is the important one for that error message, but it doesn’t hurt to check the other one as well):


You also have the option to relocate the physical DB files (MDF and LDF files) during a SSMS restore using the Files portion of the Restore dialog. This has nothing to do with the error, and is rarely necessary…


SambaPOS has a similar option to overcome the error, allowing overwrite…

1 Like