Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 242407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:50:06+00:00 2026-05-11T20:50:06+00:00

I want to convert below SQL Server code to VBScript in classic ASP… DECLARE

  • 0

I want to convert below SQL Server code to VBScript in classic ASP…

DECLARE @idoc int
DECLARE @xdoc nvarchar(4000)
DECLARE @xmldoc xml
Set @xmldoc = '<Root><Authors au_id="409-56-7008" au_lname="Bennet" au_fname="Abraham"><Titles title="The Busy Executive&apos;s Database Guide"/></Authors><Authors au_id="648-92-1872" au_lname="Blotchet-Halls" au_fname="Reginald"><Titles title="Fifty Years in Buckingham Palace Kitchens"/></Authors><Authors au_id="238-95-7766" au_lname="Carson" au_fname="Cheryl"><Titles title="But Is It User Friendly"/></Authors><Authors au_id="722-51-5454" au_lname="DeFrance" au_fname="Michel"><Titles title="The Gourmet Microwave"/></Authors><Authors au_id="712-45-1867" au_lname="del Castillo" au_fname="Innes"><Titles title="Silicon Valley Gastronomic Treats"/></Authors><Authors au_id="427-17-2319" au_lname="Dull" au_fname="Ann"><Titles title="Secrets of Silicon Valley"/></Authors><Authors au_id="267-41-2394" au_lname="Ellis" au_fname="Michael"><Titles title="Cooking with Computers: Surreptitious Balance Sheets"/><Titles title="Sushi for Anyone"/></Authors><Authors au_id="213-46-8915" au_lname="Green" au_fname="Marjorie"><Titles title="The Busy Executive&apos;s Database Guide"/><Titles title="You Can Combat Computer Stress"/></Authors></Root>' 

SELECT 
 Authors.value('./@au_id', 'varchar(20)') as au_id,
 Authors.value('./@au_fname', 'varchar(20)') as au_fname,
 Authors.value('./@au_lname', 'varchar(20)') as au_lname,
 Authors.value('Titles[1]/@title', 'varchar(20)') as Title
FROM 
@xmldoc.nodes('/Root/Authors') as TableValues(Authors)

How write the above code in classic ASP (VBScript)?

Can you help me with this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:50:06+00:00Added an answer on May 11, 2026 at 8:50 pm
    <%
    
    Dim xmldoc
    Set xmldoc = Server.CreateObject("MSXML2.DOMDocument.4.0")
    
    xmldoc.SetProperty "SelectionLanguage", "XPath"
    ''# note the escaped double quotes
    xmldoc.LoadXml "<Root><Authors au_id=""409-56-7008"" au_lname=""Bennet"" au_fname=""Abraham""><Titles title=""The Busy Executive&apos;s Database Guide""/></Authors><Authors au_id=""648-92-1872"" au_lname=""Blotchet-Halls"" au_fname=""Reginald""><Titles title=""Fifty Years in Buckingham Palace Kitchens""/></Authors><Authors au_id=""238-95-7766"" au_lname=""Carson"" au_fname=""Cheryl""><Titles title=""But Is It User Friendly""/></Authors><Authors au_id=""722-51-5454"" au_lname=""DeFrance"" au_fname=""Michel""><Titles title=""The Gourmet Microwave""/></Authors><Authors au_id=""712-45-1867"" au_lname=""del Castillo"" au_fname=""Innes""><Titles title=""Silicon Valley Gastronomic Treats""/></Authors><Authors au_id=""427-17-2319"" au_lname=""Dull"" au_fname=""Ann""><Titles title=""Secrets of Silicon Valley""/></Authors><Authors au_id=""267-41-2394"" au_lname=""Ellis"" au_fname=""Michael""><Titles title=""Cooking with Computers: Surreptitious Balance Sheets""/><Titles title=""Sushi for Anyone""/></Authors><Authors au_id=""213-46-8915"" au_lname=""Green"" au_fname=""Marjorie""><Titles title=""The Busy Executive&apos;s Database Guide""/><Titles title=""You Can Combat Computer Stress""/></Authors></Root>"
    
    Dim Author
    
    Response.Write "<table>" & vbNewLine
    For Each Author In xmldoc.SelectNodes("/Root/Authors")
      Response.Write "<tr>" & vbNewLine
      WriteTableCell Author.GetAttribute("au_id")
      WriteTableCell Author.GetAttribute("au_fname")
      WriteTableCell Author.GetAttribute("au_lname")
      WriteTableCell Author.SelectSingleNode("Titles[1]/@title")
      Response.Write "</tr>" & vbNewLine
    Next
    Response.Write "</table>" & vbNewLine
    
    ''# table cell output factored into a Sub, for reuse and cleaner code
    Sub WriteTableCell(xmldata)
      Dim s
    
      If IsObject(xmldata) Then
        If xmldata Is Nothing Then
          s = ""
        Else
          s = xmldata.text
        End If
      Else
        s = CStr(xmldata)
      End If
    
      Response.Write "<td>" & Server.HTMLEncode(s) & "</td>" & vbNewLine
    End Sub
    
    %>
    

    Tested, works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing some problems converting the PHP SQL insertion code below to ASP,
I want to convert the below code to C#: struct Elf32_Ehdr { uint8 e_ident[16];
I want to convert below SQL query to linq query but I confused: SELECT
I want to convert below string to an array in javascript. {a:12, b:c, foo:bar}
I want to convert a pointer *int to its real value int , in
I want to convert the perl function below to PHP function, if someone could
I am using SQL Server 2005. I want to create a stored procedure that
I have a large set of classic ASP pages to convert. I will be
hi guys i am stuck converting below sql to LINQ query. all i want
QI want to display queried records from SQl Server which are in a table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.