Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Few questions on displaying information out of an ASP

I am wanting to pull information out of a database and send it to a phone, later I will figure out how to accept the username variable from the phone itself but for now I am just trying to figure out how to display information on a phone...

Here is my code, I want to basically create two headings on my phone.

Heading One will display the rsinfo

Heading Two will display the rsinfo2

I have a query in my code, variables are rsinfo and rsinfo2. This ASP page works fine in a browser, it connects to my database and returns all my required info into a HTML table displayed in my web browser.

I am kind of new at this so I hope I made sense. :)

Here is the asp code...

<%

'Variables.

Dim cnnDB, strQuery, strQuery2, rsInfo, rsInfo2

'Connection Instance

Set cnnDB = Server.CreateObject("ADODB.Connection")

cnnDB.Open "DSN=slx"

'SQL query strings.

strQuery = "SELECT * FROM OPPS"

strQuery2 = "SELECT count(Meetings) FROM OPPS WHERE Meetings = 'Day'"

'Execute query and return a recordset.

Set rsInfo = cnnDB.Execute(strQuery)

Set rsInfo2 = cnnDB.Execute(strQuery2)

%>

<HTML>

<HEAD>

<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

</HEAD>

<BODY>

<CENTER><H2>

Cisco Test</H2>

<BR>

<TABLE>

<TR>

<TH align="left">

Opps Day

</TH>

<td width="15"><br></td>

<TH align="left">

Opps Night

</TH>

<td width="15"><br></td>

<TH align="left">

Opps Old

</TH>

<td width="15"><br></td>

<TH align="left">

Opps Count

</TH>

</TR>

<%

Do While Not rsInfo.EOF

%>

<TR>

<TD><% =rsInfo("Meetings") %></TD>

<td width="15"><br></td>

<TD><% =rsInfo("MeetingsNight") %></TD>

<td width="15"><br></td>

<TD><% =rsInfo("MeetingsTotal") %></TD>

<td width="15"><br></td>

<TD><% =rsInfo2("") %></TD>

<td width="15"><br></td>

</TR>

<%

'Move to the next record in the

'recordset

rsInfo.MoveNext

Loop

'Close the recordset.

rsInfo.Close

rsInfo2.Close

'Close the database connection.

cnnDB.Close

%>

</TABLE>

</CENTER>

</BODY>

</HTML>

4 REPLIES
Silver

Re: Few questions on displaying information out of an ASP

Have you made any progress on this since the 17th?

You'll want the IP Phone Services SDK if you don't have it yet already.

http://www.cisco.com/warp/public/570/

You'll need to be a part of the Developer Support Program to get access to it and other materials.

Another good source for creating Cisco IP Phone services is "Developing Cisco IP Phone Services: A Cisco AVVID Solution" by Cisco Press. You can find and preview this book on O'Reilly's Network Safari (http://safari.oreilly.com/). Safari offers a free 14-day trial, so you can get the full content of the book at no cost and get started right away! You'll find everything you need to develop Cisco IP Phone services in this book.

http://safari.oreilly.com/JVXSL.asp?x=1&mode=section&sortKey=rank&sortOrder=desc&view=book&xmlid=1-58705-060-9&open=false&srchText=ip+phone+service&code=&h=&m=&l=1&catid=&s=1&b=1&f=1&t=1&c=1&u=1&r=&o=1&page=0

So there are some of the resources that you're going to want to follow up on if you haven't already. In answer to your question, to make your content Cisco-phone friendly, you need to set the output format to text/xml (ie Response.ContentType = "text/xml";) and instead of using HTML tags, use the Cisco XML tags (which are defined in the SDK or the book), such as the CiscoIPPhoneText tag:

This is the Title

Prompt Text Goes Here

Insert all of your text here

New Member

Re: Few questions on displaying information out of an ASP

Thanks a bunch for the reply!

I took your advice and made some nifty little asp test file and it works, I can display information on the phone. Once I add my DB code everything still works, once I try and display my DB Query results I get an error on my phone that says:

XML Error [4]: Parse Error

Here is my code, this works perfect in a web browser as the query runs fine.

<%

response.ContentType = "text/xml"

set conn=Server.CreateObject("ADODB.Connection")

conn.open "DSN=slx"

sql="select count(userid) from sysdba.history where opportunityid ='OWST9a0001UU'"

set rs=Conn.Execute(sql)

response.ContentType = "text/xml"

while (not rs.EOF)

Response.ContentType = "text/xml"

Response.write("")

Response.write("This is the Title")

Response.write("Prompt Text Goes Here")

response.write("" & rs("") & "")

Response.write("Insert all of your text here")

Response.write("")

rs.MoveNext

wend

conn.close()

%>

Don't know why it wont work with my phone,

I will buy that book but I did get a good look at it before, if I remember there was little to no information about how to use the cisco phone to pull information out of a database. There has to be something I am doing wrong here. Maybe what I am trying to do is not possible?

Re: Few questions on displaying information out of an ASP

Hi,

In the CiscoIPPhoneText data type is not an allowed field.....

That is why there is a parse error, the phone can't parse this field.

btw, you can only send this once, it looks like you are looping through your results....(i am not a VB-guru...)

regards,

Sascha

Silver

Re: Few questions on displaying information out of an ASP

Ah, the error you are getting is probably due to your using the tag, which is not a recognized Cisco XML tag:

response.write("" & rs("") & "")

Don't use the tag, and instead put the username in the tag (perhaps with a \n linefeed after it if you'd like to seperate it from the user's data) and it should work.

Yes, that book won't talk about getting info from a database, as that is an ASP/Javascript/VBScript issue, and so a book covering web design with ASP would be more suited to your needs.

108
Views
0
Helpful
4
Replies