Using SQL Server to Append New Products to AbleCommerce

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
euroluxantiques
Commander (CMDR)
Commander (CMDR)
Posts: 118
Joined: Sat Dec 20, 2008 11:27 pm

Using SQL Server to Append New Products to AbleCommerce

Post by euroluxantiques » Mon Jan 05, 2009 8:33 pm

I have created some queries to append new products into dbo_ac_Products from my SQL Server products database. When I append new products, it seems to crash the database, although it seems as if I am not violating any keys when I do the append.

Once the products are appended, I also append this product info to dbo_ac_CatalogNodes, using the product id generated in dbo_ac_Products.

Is there some sort of rebuild routine that should be run after appending these products so that the database does not crash after appending? I always back the database up before appending so I can restore it, but it seems to me this must be possible to append records successfully.

I know that there is the DataPort to append info, but I don't really want to use that selection because it requires me to produce an XML file with all the new products, export that to a flat file and then open DataPort to transfer the information. I am really looking for a seemless operation that can be handled via SQL Server Agent, as much of my other web marketing is automated. It seems that if it can be done via DataPort, it should be able to be done via append queries, as long as I follow the same protocol in DataPort. Any help you can give would be appreciated. Thanks!

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: Using SQL Server to Append New Products to AbleCommerce

Post by nickc » Tue Jan 06, 2009 10:34 am

Safer and easier to use code/CommerceBuilder objects to add products:

Code: Select all

Product myProduct = new Product();
myProduct.Name = importedName;
... etc
myProduct.Save()
Also better for automation, as you can expose your code as a web method.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Using SQL Server to Append New Products to AbleCommerce

Post by jmestep » Tue Jan 06, 2009 12:33 pm

The dataport doesn't require you to use an xml file if you are wanting to add products without options, etc. You can use a csv and put in the categories you want, then everything is added to the database where it should be.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

euroluxantiques
Commander (CMDR)
Commander (CMDR)
Posts: 118
Joined: Sat Dec 20, 2008 11:27 pm

Re: Using SQL Server to Append New Products to AbleCommerce

Post by euroluxantiques » Wed Jan 07, 2009 8:11 am

How do we access Code Builder? I just installed AbleCommerce and am still learning how the various modules are set up.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Using SQL Server to Append New Products to AbleCommerce

Post by mazhar » Wed Jan 07, 2009 8:15 am

You just need to import the appropriate namespace into your code and classes in that namespace will be made available to you. For example if you want to use the Product object then first you will need to add an import statement for CommerceBuilder.Products namespace. Have a look at some conlib control for sample, for example check the ConLib/Basket.ascx.cs control code file.

Also please have a look at this, it may help you
http://wiki.ablecommerce.com/index.php/ ... uilder_API

Post Reply