Advertisement
| Hall of Fame |
|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: |
'//RETRIVES THE FIELDS SELECTED FROM THE MULTI SELECT BOX (Step1)
strSelected = Request.Form("SelectedFields")
'//CREATES THE SQL STATEMENT TO RETRIVE THE CORRECT FIELDS FROM THE DB
strSQL = "SELECT " & strSelected & " FROM tblProducts WHERE intActiveProduct = 1"
'//REPLACES ALL OF THE FIELD NAMES WITH USER FRIENDLY FIELD NAMES TO GIVE ME A STRING
'//FOR THE CSV FILE HEADER LINE
strHeader = Replace(strSelected, "intProductID", "ProductID")
strHeader = Replace(strHeader, "txtProductCode", "ProductCode")
strHeader = Replace(strHeader, "intCategoryID", "Category")
strHeader = Replace(strHeader, "intSubCategoryID", "SubCategory")
strHeader = Replace(strHeader, "intSubCategory1ID", "SecondaryCategory1")
strHeader = Replace(strHeader, "intSubCategory2ID", "SecondaryCategory2")
strHeader = Replace(strHeader, "intCategoryFeature", "CategoryFeature")
strHeader = Replace(strHeader, "intCostPrice", "CostPrice")
strHeader = Replace(strHeader, "intRetailPrice", "RetailPrice")
strHeader = Replace(strHeader, "txtProductName", "ProductName")
strHeader = Replace(strHeader, "intManufacturer", "Manufacturer")
strHeader = Replace(strHeader, "txtManufacturerPartNumber", "ManufacturerPartNo")
strHeader = Replace(strHeader, "txtModelNumber", "ModelNumber")
strHeader = Replace(strHeader, "intWeight", "Weight")
strHeader = Replace(strHeader, "txtProductDescription", "Description")
strHeader = Replace(strHeader, "intStockOnHand", "StockOnHand")
strHeader = Replace(strHeader, "intMinimumStockLevel", "MinStockLevel")
strHeader = Replace(strHeader, "intActiveProduct", "ActiveProduct")
strHeader = Replace(strHeader, "intWebProduct", "WebProduct")
strHeader = Replace(strHeader, "intFeaturedProduct", "FeaturedProduct")
strHeader = Replace(strHeader, "txtShortDescription", "ShortDescription")
strHeader = Replace(strHeader, "intBestSeller", "BestSeller")
strHeader = Replace(strHeader, "txtBarCode", "BarCode")
strHeader = Replace(strHeader, "intVatCode", "VatRate")
strHeader = Replace(strHeader, "intRRP", "RRP")
strHeader = Replace(strHeader, "txtSeoTitle", "SEOTitle")
strHeader = Replace(strHeader, "txtMetaKeywords", "SEOKeywords")
strHeader = Replace(strHeader, "txtMetaDescription", "SEODescription")
strHeader = Replace(strHeader, "txtPackSize", "PackSize")
strHeader = Replace(strHeader, "txtMemo", "Memo")
'//REPLACES ALL OF THE COMMAS FOR THE TABBED HEADER LINE
strTabbedHeader = Replace(strHeader, ",", chr(9))
'//IF THE FILETYPE IS TAB DELIMITED THEN RUN THIS SCRIPT
IF intFileType = 1 THEN
txtFileName = txtFileName & ".txt"
Set fso = Server.CreateObject("Scripting.FileSystemObject")
path = Server.MapPath(strDownloadCatalogueWebPath)
Set fldr = fso.GetFolder(path)
Set TextStream = fldr.CreateTextFile(txtFileName)
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open SQL,Connection,3,3
TextStream.WriteLine strTabbedHeader
TextStream.WriteLine RS.GetString(,,chr(9),vbCrlf,"")
RS.Close
Set RS = Nothing
TextStream.Close
'//ELSE CREATE THE CSV FILE TYPE
ELSE
txtFileName = txtFileName & ".csv"
Set fso = Server.CreateObject("Scripting.FileSystemObject")
path = Server.MapPath(strDownloadCatalogueWebPath)
Set fldr = fso.GetFolder(path)
Set TextStream = fldr.CreateTextFile(txtFileName)
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open strSQL,Connection,3,3
TextStream.WriteLine strHeader
TextStream.WriteLine RS.GetString(,,",", vbcrlf, "")
RS.Close
Set RS = Nothing
TextStream.Close
END IF
|