SambaPOS 5 Bulk Product and Inventory Importer


Thanks Ken,

Can you suggest what you use with this import tool so i can try?

If you can help me with any of your links on this forum on this subject i would appreciate a lot

Thank You


I don’t use this tool but I would probably use IIS myself just so I could serve all my various websites projects with one service.

This forum probably won’t help you much with Web server and PHP setup and install because it’s a Samba POS forum so I can’t provide forum links simply because there aren’t any that I know of.

There are some members with more experience with WAMP that might find interest in your question but I wouldn’t wait around. Google wamp server setup see what you can find.

PS read what I said about IIS and your port likely that’s your issue it can’t start because IIS is already using that port.


Kendash is correct. That is an error coming from IIS. I don’t use WAMP myself. I use IIS.

WAMP is “supposed to be” an easy, simple way to get Web Services with PHP up and running on Windows, which is why it is suggested. I tried WAMP a couple times throughout the years, but since IIS is built into Windows, I see no need to install WAMP, which uses Apache as it’s Web Server.

If you really want to use WAMP, you should disable/uninstall IIS. This is done via Add/Remove Programs > Windows Programs.

Here is a link to setting up IIS/PHP that I put together if you want to give that a go instead, since you already have IIS activated …


I keep getting the following error when trying to import my csv file

PHP Warning: odbc_execute(): SQL error: [Microsoft][SQL Server Native Client 11.0]Invalid character value for cast specification, SQL state 22005 in SQLExecute in C:\inetpub\wwwroot\dbops_functions.php on line 69

Any ideas what could be causing this


Looks like an invalid character for cast :slight_smile:


Well that part was obvious :smile: What characters would be classed as invalid?


I dont know you have not showed us it yet.

Edit: what version of SQL are you using?


the excel file contains over 1700 products so I don’t think anyone is going to check through that.
If i knew what characters are classed as invalid maybe I could search for them.


Is it not showing the line number where it fails?


No unfortunately that would make it a lot easier


So, no lines are being imported?

What about the query that is being executed at the time? Does it show that?


I just get the error I posted above.

Nothing gets added to the database


Could it be the version of SQL not supporting it?


Ok, weird.

Open the dbops_functions.php file and find this at line 58, and change the $showQuery variable to true, save, and re-run…

    $showQuery=false; // change this to true
    if ($showQuery) {
        echo "<br />QUERY:<br />$query";
        echo "<br />QPARMS:<br />";
	for ($p=0; $p<count($qparms); $p++) {
            $msg2.=$qparms[$p].", ";

Also, you have configured the tool to use driver 11 which is SQL 2014. Is that the correct SQL version that you are using?


Ok changing that makes no difference.
Yes driver 11 and SQL Express 2014.


I think it won’t fix the issue. It expected to display more info about failing query.


In the file dbops_readfile.php find this line (107) …

$ProductItemType[$r] = (($ProductItemType[$r]!=0 && $ProductItemType[$r]!=1) ? 0 : $ProductItemType[$r]);

Replace it with this:

$ProductItemType[$r] = ((($ProductItemType[$r]!=0 && $ProductItemType[$r]!=1) || $ProductItemType[$r]=='') ? 0 : $ProductItemType[$r]);

Also, you have not set a MenuName in your csv file. You need to do that for every row of data.


Ok that seems to have done the trick.

I didn’t think I had to assign a menu.

MenuName [text] (required:no) (Default: [blank])
The Name of the Menu where this Product will be placed. Leave this field blank if you do not want the Product assigned to a Menu.

But it works when I add one


Yah, that is how it was supposed to work, but somewhere along the way, I broke that part.

I uploaded v124c with some changes to take care of both of the issues you encountered. The download link in the original post has been updated.

 v124c (2016-07-14) QMcKay
  - FIX: issue with missing ProductItemType
  - FIX: MenuName is no longer required in CSV file (can be blank)
  - NEW: CSS file added for style - dbops.css
  - NEW: elapsed timer to indicate something is executing
  - NEW: parameter to set maximum execution time


"v124c (2016-07-14) QMcKay

  • FIX: issue with missing ProductItemType"

Unfortunately this error I continue to have:

23000 [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot insert the value NULL into column ‘ItemType’, table ‘SambaPOSf.dbo.RecipeItems’; column does not allow nulls. INSERT fails.
INSERT INTO [RecipeItems] ( [RecipeId] ,[Quantity] ,[InventoryItem_Id] ,[OrderTag] ,[ItemType] ) VALUES (?,?,?,?,?)
3, 1, 3, , ,