sladerwilson
11-12-2007, 08:37 AM
I have "some" experience in programming ASP/SQL - the code that follows works... but I want to get this script OFF my webserver. I can't get this code to work (in VBA)... can someone help me?
This is the ASP/SQL Code:
Dim i
For i = 1 To 2500
'Get the first product that has NOT been processed
objRst.Open "SELECT TOP 1 * from export WHERE Field48 = 'C' AND onWeb <> 'y' ORDER BY Field2 ASC"
Dim strItemName, strID
strItemName = objRst("Field45")
strID = objRst("Field2")
objRst.Close
'Set all items to MFD that are not Core Items, yet still have the same name but don't have any attributes.
objRst.Open "UPDATE export SET CoreItemStatus = 'MFD' WHERE Field45 = '"& strItemName &"' AND Field48 <> 'C' AND Field44=''"
'Now set all items to MFD that are ST-xxxxx items but DON'T have the ID of the first ST-xxxx item
objRst.Open "UPDATE export SET CoreItemStatus = 'MFD' WHERE Field45 = '"& strItemName &"' AND Field48 = 'C' AND Field2 <> '"& strID &"' AND Field44=''"
objRst.Open "UPDATE export SET Field48 = 'Y' WHERE Field45 = '"& strItemName &"' "
Next
Response.Write("Done!")
This is the ASP/SQL Code:
Dim i
For i = 1 To 2500
'Get the first product that has NOT been processed
objRst.Open "SELECT TOP 1 * from export WHERE Field48 = 'C' AND onWeb <> 'y' ORDER BY Field2 ASC"
Dim strItemName, strID
strItemName = objRst("Field45")
strID = objRst("Field2")
objRst.Close
'Set all items to MFD that are not Core Items, yet still have the same name but don't have any attributes.
objRst.Open "UPDATE export SET CoreItemStatus = 'MFD' WHERE Field45 = '"& strItemName &"' AND Field48 <> 'C' AND Field44=''"
'Now set all items to MFD that are ST-xxxxx items but DON'T have the ID of the first ST-xxxx item
objRst.Open "UPDATE export SET CoreItemStatus = 'MFD' WHERE Field45 = '"& strItemName &"' AND Field48 = 'C' AND Field2 <> '"& strID &"' AND Field44=''"
objRst.Open "UPDATE export SET Field48 = 'Y' WHERE Field45 = '"& strItemName &"' "
Next
Response.Write("Done!")