Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Return SQL data as XMLReturn SQL data as XML
Previous
 
Next
New Post
7/27/2006 12:34 PM
 
I need to return data from the DNN Database as XML. I have an OpenLaszlo app running in an IFrame which needs to pull data from an asp file that returns XML. I found this which seems to do what I want, but I have no clue how to make it connect to the DNN Database. I've tried a bunch of modifications to the cn.Open line but nothing works as I'm pretty much shooting in the dark. There's probably a pretty simple solution so if anyone could help I'd appreciate it.

Thanks
 
 
New Post
7/28/2006 9:39 AM
 

There is nothing special about the dnn database.  It is just a sql server database.  Maybe you could show us something you have tried and what the errors you recieved are

mj


Michael Jackson
Brillnat.com
Custom module development
Database access tokenized HTML modules
 
New Post
7/28/2006 10:22 AM
 
Hmm guess I wasn't clear enought. I just made an .asp page with the code that the page I linked to shows:

<%
'Very Important : Set the ContentType property of
'the Response object to text/xml.

Response.ContentType = "text/xml"

Dim cn
Dim rs
Dim xmlDoc

Set cn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.Recordset")

'Replace the ADO Connection string attributes
'in the following line of code to point to your
'instance of SQL Server, and to specify the
'required security credentials for User ID and Password.

cn.Open "Provider=SQLOLEDB.1;" & _
        "User ID=host;" & _
        "Password=dnnhost;" & _
        "Data Source=SQLEXPRESS"

rs.CursorLocation = 3
rs.Open "Select * from Users",cn

Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")

'Persist the Recorset in XML format to the DOMDocument object.
'The constant value for adPersistXML is 1.

rs.Save xmlDoc,1

rs.Close
cn.Close

Set rs = Nothing
Set cn = Nothing

'Write out the xml property of the DOMDocument
'object to the client Browser
Response.Write xmldoc.xml
%>

I get an error on this line:
cn.Open "Provider=SQLOLEDB.1;" & _
        "User ID=host;" & _
        "Password=dnnhost;" & _
        "Data Source=SQLEXPRESS"

It says:
  • Error Type:
    Microsoft OLE DB Provider for SQL Server (0x80004005)
    [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
    /dnnn/xml.asp, line 19

  • As I said before I have no idea what to put on that line, but I'll keep trying stuff.

     
    New Post
    7/29/2006 11:26 PM
     

    Account (host, dnnhost) is not the database account.  It is an application account.  You need to specify a database account in the connection string.  Check the web.config file to see the database account.


    Robert Tango
    www.workcontrol.com
    Custom Modules: UserManager|UserDirectory|UserImport|PortalSSO
     
    Previous
     
    Next
    HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Return SQL data as XMLReturn SQL data as XML


    These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

    For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

    1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
    2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
    3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
    4. No Flaming or Trolling.
    5. No Profanity, Racism, or Prejudice.
    6. Site Moderators have the final word on approving / removing a thread or post or comment.
    7. English language posting only, please.
    What is Liquid Content?
    Find Out
    What is Liquid Content?
    Find Out
    What is Liquid Content?
    Find Out