Solved

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

Posted on 2006-10-24
10
346 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:
ingwa earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 11

Author Comment

by:Andrew Angell
Comment Utility
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
Comment Utility
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:ingwa
Comment Utility
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
Comment Utility
Hi mrichmon,

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now