Error with reponse.write

Discussion in 'ASP General' started by CD, Apr 21, 2004.

  1. CD

    CD Guest

    I have code from a book that appears work except for the writing the
    reuslts. I am querying AD and writing the results. I get the error:

    Error Type:
    Microsoft VBScript runtime (0x800A000D)
    Type mismatch
    /adlookup/results.asp, line 89

    Which is the line> Response.Write "<TD>" & adoRecordSet.Fields("cn") &
    "</TD>"

    TIA
    CD

    CODE SNIP:

    ' Create ADO connection using the ADSI OLE DB provider
    Set adoConnection = Server.CreateObject ("ADODB.Connection")
    adoConnection.Open "Provider=ADsDSOObject;"

    ' Create ADO commmand object and associate with the connection
    Set adoCommand = Server.CreateObject ("ADODB.Command")
    adoCommand.ActiveConnection = adoConnection

    ' Create the command string using the four parts
    adoCommand.CommandText = strBase & ";" & strFilter & ";" & _
    strAttributes & ";" & strScope

    ' Set the number of records in the recordset logical page
    adoCommand.Properties("Page Size") = 20

    ' Set the maximum result size
    adoCommand.Properties("Size Limit") = 20

    ' Sort the results based on the cn attribute
    adoCommand.Properties("Sort On") = "cn"

    ' Execute the query for the user in the directory
    Set adoRecordSet = adoCommand.Execute

    If adoRecordSet.EOF Then
    Response.Write "</TBODY><THEAD><TH>No names found</TH></THEAD>"
    Else
    ' Loop through all the returned records
    While Not adoRecordSet.EOF
    ' Display the row using the selected fields
    Response.Write "<TR>"
    Response.Write "<TD>" & adoRecordSet.Fields("cn") & "</TD>"

    ' Check to see if telephone number field is null
    If IsNull( adoRecordSet.Fields("telephoneNumber") ) Then
    Response.Write "<TD>(number not listed)</TD>"
    Else
    ' Retrieve the telephone number and add to the display line
    Response.Write "<TD>" & _
    adoRecordSet.Fields("telephoneNumber") & "</TD>"
    End If

    ' End the row
    Response.Write "</TR>"
     
    CD, Apr 21, 2004
    #1
    1. Advertising

  2. CD wrote:
    > I have code from a book that appears work except for the writing the
    > reuslts. I am querying AD and writing the results. I get the error:
    >
    > Error Type:
    > Microsoft VBScript runtime (0x800A000D)
    > Type mismatch
    > /adlookup/results.asp, line 89
    >
    > Which is the line> Response.Write "<TD>" &
    > adoRecordSet.Fields("cn") & "</TD>"
    >


    Response.Write "<TD>" & adoRecordSet.Fields("cn").Value & _
    "</TD>"

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Apr 21, 2004
    #2
    1. Advertising

  3. CD

    CD Guest

    Thanks for the reply

    I still get error on that line.

    Error Type:
    Microsoft VBScript runtime (0x800A000D)
    Type mismatch
    /adlookup/results.asp, line 89


    "Bob Barrows [MVP]" <> wrote in message
    news:uxe2cb%...
    > CD wrote:
    > > I have code from a book that appears work except for the writing the
    > > reuslts. I am querying AD and writing the results. I get the error:
    > >
    > > Error Type:
    > > Microsoft VBScript runtime (0x800A000D)
    > > Type mismatch
    > > /adlookup/results.asp, line 89
    > >
    > > Which is the line> Response.Write "<TD>" &
    > > adoRecordSet.Fields("cn") & "</TD>"
    > >

    >
    > Response.Write "<TD>" & adoRecordSet.Fields("cn").Value & _
    > "</TD>"
    >
    > Bob Barrows
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
     
    CD, Apr 22, 2004
    #3
  4. I can't help without knowing what's in the recordset. Save your recordset to
    an xml file and post the contents of the xml file in your reply to this
    message. To save your recordset, do this (after opening it):

    adoRecordSet.Save "recordset.xml", 1

    You will be able to open the xml file in Notepad and copy the text into your
    reply post.

    Bob Barrows

    CD wrote:
    > Thanks for the reply
    >
    > I still get error on that line.
    >
    > Error Type:
    > Microsoft VBScript runtime (0x800A000D)
    > Type mismatch
    > /adlookup/results.asp, line 89
    >
    >
    > "Bob Barrows [MVP]" <> wrote in message
    > news:uxe2cb%...
    >> CD wrote:
    >>> I have code from a book that appears work except for the writing the
    >>> reuslts. I am querying AD and writing the results. I get the
    >>> error:
    >>>
    >>> Error Type:
    >>> Microsoft VBScript runtime (0x800A000D)
    >>> Type mismatch
    >>> /adlookup/results.asp, line 89
    >>>
    >>> Which is the line> Response.Write "<TD>" &
    >>> adoRecordSet.Fields("cn") & "</TD>"
    >>>

    >>
    >> Response.Write "<TD>" & adoRecordSet.Fields("cn").Value & _
    >> "</TD>"
    >>
    >> Bob Barrows
    >> --
    >> Microsoft MVP -- ASP/ASP.NET
    >> Please reply to the newsgroup. The email account listed in my From
    >> header is my spam trap, so I don't check it very often. You will get
    >> a quicker response by posting to the newsgroup.


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Apr 22, 2004
    #4
  5. CD

    CD Guest

    Thanks Bob

    I add the line after the set open

    ' Execute the query for the user in the directory
    Set adoRecordSet = adoCommand.Execute

    adoRecordSet.Save "recordset.xml", 1

    and get

    Error Type:
    Provider (0x80030103)
    Can't save.
    /adlookup/results.asp, line 82
     
    CD, Apr 22, 2004
    #5
  6. CD wrote:
    > Thanks Bob
    >
    > I add the line after the set open
    >
    > ' Execute the query for the user in the directory
    > Set adoRecordSet = adoCommand.Execute
    >
    > adoRecordSet.Save "recordset.xml", 1
    >
    > and get
    >
    > Error Type:
    > Provider (0x80030103)
    > Can't save.
    > /adlookup/results.asp, line 82


    You need to save it into a folder where either you or the IUSR account
    (depending on what kind of authentication is being used by the site) has
    file creation permissions.

    As an alternative, you can use the code on this page to pass the recordset
    xml to the client:
    http://www.davidpenton.com/testsite/tips/xml.recordset.server2client.asp

    and then view the page's source to copy the xml.

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Apr 22, 2004
    #6
  7. CD

    CD Guest

    OK I gave the IUSR acct permission to write to my local drive.
    This is what I get with the line Line87: adoRecordSet.Save "recordset.xml",
    1

    Error Type:
    Microsoft OLEDB Persistence Provider (0x80040E1D)
    Requested conversion is not supported.
    /adlookup/results.asp, line 87

    This being the case do you think the page conversion will even work?

    I reall appericate your help on this.


    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > CD wrote:
    > > Thanks Bob
    > >
    > > I add the line after the set open
    > >
    > > ' Execute the query for the user in the directory
    > > Set adoRecordSet = adoCommand.Execute
    > >
    > > adoRecordSet.Save "recordset.xml", 1
    > >
    > > and get
    > >
    > > Error Type:
    > > Provider (0x80030103)
    > > Can't save.
    > > /adlookup/results.asp, line 82

    >
    > You need to save it into a folder where either you or the IUSR account
    > (depending on what kind of authentication is being used by the site) has
    > file creation permissions.
    >
    > As an alternative, you can use the code on this page to pass the recordset
    > xml to the client:
    > http://www.davidpenton.com/testsite/tips/xml.recordset.server2client.asp
    >
    > and then view the page's source to copy the xml.
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
     
    CD, Apr 22, 2004
    #7
  8. What version of ADO do you have? You can find out by doing

    response.write conn.version

    Any chance of upgrading to the latest version?

    What do you get when you do

    response.write adoRecordSet.Fields("cn").Type

    Bob Barrows

    CD wrote:
    > OK I gave the IUSR acct permission to write to my local drive.
    > This is what I get with the line Line87: adoRecordSet.Save
    > "recordset.xml", 1
    >
    > Error Type:
    > Microsoft OLEDB Persistence Provider (0x80040E1D)
    > Requested conversion is not supported.
    > /adlookup/results.asp, line 87
    >
    > This being the case do you think the page conversion will even work?
    >
    > I reall appericate your help on this.
    >
    >
    > "Bob Barrows [MVP]" <> wrote in message
    > news:...
    >> CD wrote:
    >>> Thanks Bob
    >>>
    >>> I add the line after the set open
    >>>
    >>> ' Execute the query for the user in the directory
    >>> Set adoRecordSet = adoCommand.Execute
    >>>
    >>> adoRecordSet.Save "recordset.xml", 1
    >>>
    >>> and get
    >>>
    >>> Error Type:
    >>> Provider (0x80030103)
    >>> Can't save.
    >>> /adlookup/results.asp, line 82

    >>
    >> You need to save it into a folder where either you or the IUSR
    >> account (depending on what kind of authentication is being used by
    >> the site) has file creation permissions.
    >>
    >> As an alternative, you can use the code on this page to pass the
    >> recordset xml to the client:
    >> http://www.davidpenton.com/testsite/tips/xml.recordset.server2client.asp
    >>
    >> and then view the page's source to copy the xml.
    >>


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Apr 22, 2004
    #8
  9. CD

    CD Guest

    version> 2.7

    Type> 202

    Thanks
    Chuck

    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > What version of ADO do you have? You can find out by doing
    >
    > response.write conn.version
    >
    > Any chance of upgrading to the latest version?
    >
    > What do you get when you do
    >
    > response.write adoRecordSet.Fields("cn").Type
    >
    > Bob Barrows
     
    CD, Apr 22, 2004
    #9
  10. I've just done a Google search and found a couple promising posts:

    http://groups.google.com/groups?hl=...F-8&c2coff=1&selm=uu6$XvRL$GA.277@cppssbbsa05

    http://groups.google.com/groups?hl=...F-8&c2coff=1&selm=

    http://groups.google.com/groups?hl=...-8&c2coff=1&selm=uo$UQLU$AHA.1528@tkmsftngp04

    Try
    Response.Write "<TD>" & join(adoRecordSet.Fields("cn")) & "</TD>"

    Bob Barrows



    CD wrote:
    > version> 2.7
    >
    > Type> 202
    >
    > Thanks
    > Chuck
    >
    > "Bob Barrows [MVP]" <> wrote in message
    > news:...
    >> What version of ADO do you have? You can find out by doing
    >>
    >> response.write conn.version
    >>
    >> Any chance of upgrading to the latest version?
    >>
    >> What do you get when you do
    >>
    >> response.write adoRecordSet.Fields("cn").Type
    >>
    >> Bob Barrows


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Apr 22, 2004
    #10
  11. CD

    CD Guest

    WaaaHOO

    The join did it..

    THANKS MUCHO!


    "Bob Barrows [MVP]" <> wrote in message
    news:%...
    > I've just done a Google search and found a couple promising posts:
    >
    >

    http://groups.google.com/groups?hl=...F-8&c2coff=1&selm=uu6$XvRL$GA.277@cppssbbsa05
    >
    >

    http://groups.google.com/groups?hl=...F-8&c2coff=1&selm=
    >
    >

    http://groups.google.com/groups?hl=...-8&c2coff=1&selm=uo$UQLU$AHA.1528@tkmsftngp04
    >
    > Try
    > Response.Write "<TD>" & join(adoRecordSet.Fields("cn")) & "</TD>"
    >
    > Bob Barrows
    >
    >
    >
    > CD wrote:
    > > version> 2.7
    > >
    > > Type> 202
    > >
    > > Thanks
    > > Chuck
    > >
    > > "Bob Barrows [MVP]" <> wrote in message
    > > news:...
    > >> What version of ADO do you have? You can find out by doing
    > >>
    > >> response.write conn.version
    > >>
    > >> Any chance of upgrading to the latest version?
    > >>
    > >> What do you get when you do
    > >>
    > >> response.write adoRecordSet.Fields("cn").Type
    > >>
    > >> Bob Barrows

    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
     
    CD, Apr 22, 2004
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWc=?=
    Replies:
    1
    Views:
    419
    Peter Blum
    Apr 5, 2004
  2. Simon Prince
    Replies:
    1
    Views:
    575
    Bobby Ryzhy
    Jul 14, 2004
  3. bruce barker

    Re: client reponse ports for asp.net

    bruce barker, Jul 20, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    466
    =?Utf-8?B?U2lsdmlhIEJydW5ldCBKb25lcw==?=
    Jul 20, 2004
  4. RayAll

    Reponse.Redirect ()

    RayAll, Apr 18, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    2,953
    Gabriel Lozano-MorĂ¡n
    Apr 18, 2005
  5. Jack
    Replies:
    7
    Views:
    153
    Paxton
    Nov 19, 2004
Loading...

Share This Page