Microsoft KB Archive/256259: Difference between revisions
From BetaArchive Wiki
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 44: | Line 44: | ||
== SUMMARY == | == SUMMARY == | ||
This | This "More Information" section of this article contains a code example that allows you to add a '''SimpleList''' object to an '''OrderForm''' object and store it in the database using the '''DBStorage''' object. | ||
</div> | </div> | ||
Line 59: | Line 59: | ||
Private Sub Main() | Private Sub Main() | ||
Set mysimplelist = CreateObject( | Set mysimplelist = CreateObject("Commerce.Simplelist") | ||
Set mscsorderformstorage = CreateObject( | Set mscsorderformstorage = CreateObject("Commerce.DBStorage") | ||
Set MSCSShopperManager = CreateObject( | Set MSCSShopperManager = CreateObject("Commerce.StandardSManager") | ||
Call MSCSShopperManager.InitManager( | Call MSCSShopperManager.InitManager("", "") | ||
Call mscsorderformstorage.initstorage( | Call mscsorderformstorage.initstorage("DSN=SSCommerce3;UID=SA;PWD=", "vc30_receipt", "order_id", "Commerce.Orderform", "marshalled_receipt", "date_changed") | ||
mysimplelist.Add ( | mysimplelist.Add ("value1") | ||
mysimplelist.Add ( | mysimplelist.Add ("value2") | ||
mysimplelist.Add ( | mysimplelist.Add ("value3") | ||
'You will have to paste in your own order_id argument here | 'You will have to paste in your own order_id argument here | ||
Set mscsorderform = mscsorderformstorage.GetData(Null, | Set mscsorderform = mscsorderformstorage.GetData(Null, "SGPR51TLRWS12PNS00Q799HC77") | ||
'Then once you have retrieved the orderform you can modify it as follows: | 'Then once you have retrieved the orderform you can modify it as follows: | ||
mscsorderform.prefix = | mscsorderform.prefix = "*" 'change prefix from default of underscore so dbstorage will persist any items beginning with underscore to database | ||
Set mscsorderform.list2 = mysimplelist | Set mscsorderform.list2 = mysimplelist | ||
Latest revision as of 13:53, 21 July 2020
Article ID: 256259
Article Last Modified on 6/24/2004
APPLIES TO
- Microsoft Site Server 3.0 Commerce Edition
This article was previously published under Q256259
SUMMARY
This "More Information" section of this article contains a code example that allows you to add a SimpleList object to an OrderForm object and store it in the database using the DBStorage object.
MORE INFORMATION
Use the following Visual Basic 6.0 code example to add a SimpleList object to an OrderForm object and persist the OrderForm object to the database with the DBStorage object:
Dim mysimplelist As Object Dim mscsorderformstorage As Object Dim MSCSShopperManager As Object Dim mscsorderform As Object Private Sub Main() Set mysimplelist = CreateObject("Commerce.Simplelist") Set mscsorderformstorage = CreateObject("Commerce.DBStorage") Set MSCSShopperManager = CreateObject("Commerce.StandardSManager") Call MSCSShopperManager.InitManager("", "") Call mscsorderformstorage.initstorage("DSN=SSCommerce3;UID=SA;PWD=", "vc30_receipt", "order_id", "Commerce.Orderform", "marshalled_receipt", "date_changed") mysimplelist.Add ("value1") mysimplelist.Add ("value2") mysimplelist.Add ("value3") 'You will have to paste in your own order_id argument here Set mscsorderform = mscsorderformstorage.GetData(Null, "SGPR51TLRWS12PNS00Q799HC77") 'Then once you have retrieved the orderform you can modify it as follows: mscsorderform.prefix = "*" 'change prefix from default of underscore so dbstorage will persist any items beginning with underscore to database Set mscsorderform.list2 = mysimplelist 'After modifying the orderform, you would then need to commit the modified orderform back to the marshalled column using the dbstorage commitdata method: Call mscsorderformstorage.CommitData(Null, mscsorderform) End Sub
Keywords: kbhowto kbfix KB256259