Solved

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

Posted on 2006-10-24
10
352 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
[X]
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
  • 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

734 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