Solved

Is there a way to bind my own custom created recordset into DW's bindings panel???

Posted on 2006-10-24
10
348 Views
Last Modified: 2010-04-25
I've got a little problem where I'm working with XML web services to get product data to my web site.  I'm actually parsing all of the XML data and feeding it into an ASP recordset in my page manually.  I have a 3rd party shopping cart (Web Assist eCart 3.7) that uses the bindings tab in DW to populate your shopping cart with data from a recordset.  The problem is, since this recordset wasn't actually created with DW it doesn't show up in the bindinds tab and my shopping cart extension doesn't work then (it simply grays out the dynamic shopping cart option because there isn't a recordset available...so it thinks.)

So, is there a way that I can bind my own recordset data in DW so that it can be used just like a regular recordset created in DW?  I see how you can bind Session variables and Application variables but I don't see anything for binding a manually created recordset.

Any information on this would be greatly appreciated.  Thanks!
0
Comment
Question by:Andrew Angell
  • 3
  • 2
  • 2
10 Comments
 
LVL 18

Accepted Solution

by:
Mark Gilbert earned 500 total points
ID: 17801913
Yea, insert your custom query into the advanced sql editor (which is available when creating a new recordset).  However, if your code contains things like where fieldname = '$x', the $x will bomb it out with an error.  What you could do is simply replace the $varname with a default value so that you can construct your code in dreamweaver, and the put the variable names back into the query.

Hope this helps.
0
 
LVL 11

Author Comment

by:Andrew Angell
ID: 17803995
That's not really what I'm talking about.  I'm not accessing the database via SQL queries.  I'm accessing the database via XML API. The XML values are placed into ASP variables and then fed into a recordset...that I was hoping to be able to use like any other recordset in DW.

---


      Const adVarChar = 200
 
'Create recordset to store data in to make everything work with eCart.
  Set rsProducts = CreateObject("ADODB.Recordset")
        rsProducts.Fields.Append "ProductRefNumber", adVarChar, 1000
      rsProducts.Fields.Append "ProductQTYAvailable", adVarChar, 1000
      rsProducts.Fields.Append "ProductCondition", adVarChar, 1000
      rsProducts.Fields.Append "ProductDescription", adVarChar, 1000
      rsProducts.Fields.Append "ProductManuPartNumber", adVarChar, 1000
      rsProducts.Fields.Append "ProductStreetPrice", adVarChar, 1000
      rsProducts.Fields.Append "ProductWeight", adVarChar, 1000
      rsProducts.Fields.Append "ProductCategory", adVarChar, 1000
      rsProducts.Fields.Append "ProductHot", adVarChar, 1000
      rsProducts.Open()
 
 'open the XML document
      Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
      xmlDoc.Async = false
      xmlDoc.LoadXML(InventoryResponse)
      
'parse records from response
      Set RecordsNode = xmlDoc.selectNodes("/fmresultset/resultset/record")
            For Each recordNode In RecordsNode
                  ProductRefNumber = ""
                  ProductQTYAvailable = ""
                  ProductCondition = ""
                  ProductDescription = ""
                  ProductManuPartNumber = ""
                  ProductStreetPrice = ""
                  ProductWeight = ""
                  ProductCategory = ""
                  ProductHot = ""
                  
                  ProductRefNumber = TryNode(recordNode, "field[@name='Ref_Number']/data")
                  ProductCondition = TryNode(recordNode, "field[@name='Purchase_Order_Items::Condition']/data")
                  ProductDescription = TryNode(recordNode, "field[@name='Ref_Number::Description']/data")
                  ProductManuPartNumber = TryNode(recordNode, "field[@name='Ref_Number::Manu_Part_Number']/data")
                  ProductCategory = TryNode(recordNode, "field[@name='Ref_Number::Class']/data")
                  ProductHot = TryNode(recordNode, "field[@name='Ref_Number::Hot']/data")
                  ProductStreetPrice = FormatNumber(TryNode(recordNode, "field[@name='Ref_Number::Street']/data"),2)
                  ProductWeight = TryNode(recordNode, "field[@name='Ref_Number::Weight']/data")
                  ProductQTYAvailable = TryNode(recordNode, "field[@name='Qty_Available']/data")
                  
                  rsProducts.AddNew
                        rsProducts("ProductRefNumber") = ProductRefNumber
                        rsProducts("ProductCondition") = ProductCondition
                        rsProducts("ProductDescription") = ProductDescription
                        rsProducts("ProductManuPartNumber") = ProductManuPartNumber
                        rsProducts("ProductCategory") = ProductCategory
                        rsProducts("ProductHot") = ProductHot
                        rsProducts("ProductStreetPrice") = ProductStreetPrice
                        rsProducts("ProductWeight") = ProductWeight
                        rsProducts("ProductQTYAvailable") = ProductQTYAvailable
                  rsProducts.Update
            Next
      Set RecordsNode = Nothing

---

So at this point I have a recordset that contains all of the data that I can display to the page by looping through it just like normal...but I have to do it all manually because I can't bind the recordset into DW...or at least I don't know to.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 17804684
Hi angelleye,

I think you can do this using the File | Convert command:

http://www.adobe.com/devnet/dreamweaver/articles/display_xml_data_05.html
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 11

Author Comment

by:Andrew Angell
ID: 17884915
jason1178,

that's a cool feature, but that's for using XSLT.  that's not what I'm doing here.  I'm just trying to find a way to add a manually created recordset into DW's bindings panel.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 17885535
Ok, sorry...that's the closest thing my research could come up with.  In that case, ingwa is correct about the advanced recordset dialog.  If you cannot call the query from the DW dialogs, then DW won't make it accessible via the bindings panel, AFAIK.  

However, this is ASP and I'm not totally certain how DW and ASP do their things.   In PHP, DW uses a regular expression to check the recordset code and if it falls into a certain format, it then attaches the recordset to the bindings panel.  I can only assume the same thing exists in ASP...
0
 
LVL 18

Expert Comment

by:Mark Gilbert
ID: 17886281
Hi Jason, yes, dreamweaver can interact with asp quite nicely, but the code generated is clunky.   I wouldn't use DW asp for auto-generated content, but find asp good for inserting snippets of code, so it serves the best of both worlds where it fails.

Angelleye, if you do want to try it, insert your binding, but where you have variables put in default values so that DW doesn't give you errors when it queries the database.  Then once you have you repeat regions in place and have formatted your code, copy the select block, comment out the original and then paste it and modify to pickup variable values.  Then your code should work nicely, and it will appear in the behaviours menu.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 18105598
Hi mrichmon,

No points to me.  I was totally going down the wrong track here.  ingwa only.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Find & replace in Dreamweaver code to: add +1 to many id's 3 264
WordPress on local PC and hosted 11 146
Debug PHP with Dreamweaver 6 773
Website Design 13 123
For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question