SambaPOS Forum
English Boards => Tutorials => Topic started by: JohnS on February 01, 2012, 06:32:21 am
-
Welcome to SambaPOS Training Mode.
What I have created is a tool to enable a SambaPOS Training Mode on SambaPOS.
What the tool actually does is to copy the SambaPOS Microsoft SQL Express 2005/2008 Server instance or Microsoft Compact SQL Server database to a Microsoft Compact SQL Server database file called SambaTrain.sdf, and change the SambaPOS data source settings automatically with the click of a single icon and once you exit SambaPOS, the data source settings are returned to the live settings.
Latest version - V4.0 - http://forum2.sambapos.org/index.php/topic,184.msg6222.html#msg6222 (http://forum2.sambapos.org/index.php/topic,184.msg6222.html#msg6222)
You can also have the database refresh each time you run SambaPOS Training Mode, or to refresh on-demand if you are developing new features, or expanding the POS system.
-
Cheers John,
I'll try it out later.
By the way, Thanks!
Edgar
-
John your latest update is a big improvement and that makes you a SambaPOS Dev :)
I want to include your script in SambaPOS setup. Is it possible to get rid of c:\sambatrain and use current directory instead?
-
I was thinking the same.
Do you want it in a sub directory under SambaPOS2 called Training or just in the main directory?
-
It will be fine if it works under a sub directory. If it helps during setup I can call install.vbs with current installation directory information or anything else.
-
The install script is designed to be run once you have SambaPOS up and running in your production environment.
As it is right now, if you change the database connection or location of the SambaSettings.txt file, after you have run install.vbs, the training scripts will not work.
I will change this to read the settings each time you run training mode, that way if you change databases or location of the settings file, it will work it out and run training mode.
-
Emre,
Well its at V3.0 now. Rewrote most of it so it's now just one script to do everything.
The script discovers its location and folder name, but it has to be placed in a sub directory under SambaPOS2 to work.
Test it, and let me know if you have any issues.
Features
- Will work with SQL Server Compact & SQL Server Express Databases (both local and networked)
- Checks if SQL Compact Server is installed
- Dynamic execution - no configuration required
-
On my first test it worked great... Really good idea, awesome solution.
I'll test it more but I think it is ready for next release.. Thank you very much!
-
For the record: Training script included in setup.
-
Hi John,
Tried running training mode today and got error shown on screen shot.
What are the conditions for the script to work.
Could it be because I have sql server and sql compact on my laptop?
Edgar
-
Edgar,
Its a file permission error.
You need SQL CE on the system to run training mode. Both MS SQL & SQL CE can exist on the same system.
Are you logged in as an administrator or restricted user?
Try this
1. Log into SambaPOS, go to Local Settings and make sure you are using MS SQL and not CE and exit.
2. Run Training.vbs again
I just tested and it has worked fine, but I did need to log into SambaPOS first.
-
Updated version to fix file permission errors on restricted user accounts.
I have tested on both Win 7 and Server 2003 with both standard and administrator accounts.
Please let me know if you have any issues.
Notes
- Training Compact SQL file is now located in the same folder as SambaSettings.txt file.
- Training SQL file called SambaTrain.sdf
-
Thank you John. Good solution.
I'll update your script on next release.
-
Hi John,
Run training mode script shortcut on desk top and found sambapos would start up in normal mode, ie ticket no would increment and when I restarted Sambapos from normal shortcut, found the next ticket no was incremented the last ticket no generated in training mode.
Edgar
-
Edgar,
Are you running Compact SQL ? If so, whats the location of your sdf file.
Whats the location of your SambaSettings.txt file ?
-
Hi John,
C:\Users\Edgar\Documents\SambaPOS2
SQL Server compact edition.
Hope this helps!
Edgar
-
Edgar,
Is SambaSettings.txt in the same folder?
-
Hi John,
No, It is in "C:\ProgramData\Ozgu Tech\SambaPOS2\SambaSettings.txt"
Edgar
-
Edgar,
Confirmed file permission issues with V3.0.
V3.1 & V3.2 both working with standard user account - I could not replicate your issue.
V3.2 uses SambaTrain.sdf instead of SambaData2.sdf to make sure we are using different databases.
My Testing.
- Win 7 64 Bit Ultimate.
- Created standard user with password.
- Installed SambaPOS + .NET + Compact SQL as administrator.
- Logged in as standard user and ran SambaPOS.
- Saved local settings file.
- Ran SambaPOS Training Mode, checked local settings to confirm correct database was used.
- Started work period, Logout & Exit
- Ran live version of SambaPOS and work period had not started.
I am out of ideas why you are having issues. Try V3.2 and make sure that your Desktop icon for SambaPOS Training Mode is pointing to the training.vbs script and not Samba.Presentation.exe.
-
Latest version of SambaPOS Training Mode.
Notes
- Includes /Training command line switch which when used with the Application Subtitle Action, can display at the top of the screen 'Training Mode'
How to setup 'Training Mode' title.
1. The Action
- Create a new Action called Training Mode
- Action Type = Update Application Subtitle
- Title = Training Mode
- Color = your choice
2. The Rule
- Create a new Rule called Training Mode
- Event Name = Application Started
- Conditions - CommandLineArguments = /Training
- Actions - Select Training Mode action
Now when you run SambaPOS Training Mode, you will see Training Mode at the top of the screen.
Note - If you want to refresh the training database file every time you run SambaPOS Training Mode, edit the Training.vbs file in the Training folder under C:\Program Files\SambaPos2, and change strDelTrSQLCE = False to True on the 10th line.
Emre,
Can we please get a link in the Samba POS 2 start menu group for SambaPOS Training Mode during the installation.
-
how do i know im in training mode i clicked on the training.vbs and sambapos started but it didnt show it was running in training mode?
-
how do i know im in training mode i clicked on the training.vbs and sambapos started but it didnt show it was running in training mode?
By using the setup in the post above yours.
-
Latest version of SambaPOS Training Mode.
I have made some changes to the script due to smaller 32bit systems splitting the sqlce files which would cause the SambaTrain.sdf file not to build properly.
All other features of the script stay the same.
-
hello, I'd like to know how can I change the currency symbol or: $, €, £, how can I change this part in SAMBAPOS? please help me. Gidy Cazaus