Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2006-10-24
10
349 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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