473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

can I return output from stored procedure into an HTA to display in browser?

Hi all. I have a stored procedure on my sql server that returns a
simple informtation about that tim a database was backed up. I owuld
like to create an HTA that operator types can look at to make sure
that the backups finished, can someone help me do this?

The stored procedure in called sp_lastback and the output looks like
this:

database days since backup timestamp of backup
dbase1 0 2004-10-14 00:41:21.000
dbase2 0 2004-10-14 00:08:36.000
dbase3 1 2004-10-13 22:46:57.000

Can this be done? If someone could help me with this simple problem, I
could probably reuse the same method a 100 useful ways.

Thanks in advance!
Jul 20 '05 #1
3 3152

"sumGirl" <em*****@netscape.net> wrote in message
news:a5**************************@posting.google.c om...
Hi all. I have a stored procedure on my sql server that returns a
simple informtation about that tim a database was backed up. I owuld
like to create an HTA that operator types can look at to make sure
that the backups finished, can someone help me do this?

The stored procedure in called sp_lastback and the output looks like
this:

database days since backup timestamp of backup
dbase1 0 2004-10-14 00:41:21.000
dbase2 0 2004-10-14 00:08:36.000
dbase3 1 2004-10-13 22:46:57.000

Can this be done? If someone could help me with this simple problem, I
could probably reuse the same method a 100 useful ways.

Thanks in advance!


You'll probably get a better response in a group for HTA users. I guess you
could write a client script to execute the procedure with ADO, then loop
over the ResultSet and build the .hta file dynamically, but I have no idea
about any details.

Simon
Jul 20 '05 #2
Here's a generic technique to render a resultset using dynamic html. There
may be better ways to accomplish the task, though.

<html>
<head>
<body>
<Script Language="VBScript">

Sub btnListBackups_OnClick()

Set oConnection = CreateObject("ADODB.Connection")

oConnection.Open "Provider=SQLOLEDB" & _
";Data Source=" & "DBDELTA1" & _
";Integrated Security=SSPI"

Set recordSet = oConnection.Execute("EXEC tempdb..sp_lastback")
myResultTable = "<table border=""1"">"
myResultTable = myResultTable & "<tr>"
For i = 0 To recordSet.Fields.Count - 1
myResultTable = myResultTable & _
"<th>" & _
recordSet.Fields(i).Name & _
"</th>"
Next
myResultTable = myResultTable & "</tr>"
Do While Not recordSet.EOF
myResultTable = myResultTable & "<tr>"
For i = 0 To recordSet.Fields.Count - 1
myResultTable = myResultTable & _
"<td>" & _
recordSet.Fields(i).Value & _
"</td>"
Next
myResultTable = myResultTable & "</tr>"
recordSet.MoveNext
Loop
myResultTable = myResultTable & "</table>"
recordSet.Close
oConnection.Close

Results.innerHTML = myResultTable
End Sub

</script>

<input type="button" id="btnListBackups" value="List Backups">
<hr>
<nobr Id=Results></nobr>
</body>
</html>

--
Hope this helps.

Dan Guzman
SQL Server MVP

"sumGirl" <em*****@netscape.net> wrote in message
news:a5**************************@posting.google.c om...
Hi all. I have a stored procedure on my sql server that returns a
simple informtation about that tim a database was backed up. I owuld
like to create an HTA that operator types can look at to make sure
that the backups finished, can someone help me do this?

The stored procedure in called sp_lastback and the output looks like
this:

database days since backup timestamp of backup
dbase1 0 2004-10-14 00:41:21.000
dbase2 0 2004-10-14 00:08:36.000
dbase3 1 2004-10-13 22:46:57.000

Can this be done? If someone could help me with this simple problem, I
could probably reuse the same method a 100 useful ways.

Thanks in advance!

Jul 20 '05 #3
Thanks Dan! Thats exactly the kind of example I can run with!
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: randy.p.ho | last post by:
Using JDBC, is there a way to call a stored procedure with multiple return values? Thanks.
5
by: Sandy | last post by:
Hello - I need a good example of how to take a return value from a stored procedure and use it in vb code. I have an app that searches a database by city and state. If a user makes a typo, the...
0
by: IamtheEvster | last post by:
Hi All, I am currently using PHP 5 and MySQL 5, both on Fedora Core 5. I am unable to call a MySQL stored procedure that returns output parameters using mysql, mysqli, or PDO. I'm having a...
18
by: Terry Holland | last post by:
I have an asp.net (1.1) application that connects to a SQL server 2000 db. I have a stored procedure in my db that out puts data in xml format. What I need to be able to do is display that xml...
1
by: mazdotnet | last post by:
Hi guys, I can't figure out why this is not working? I need to display all the rows for a given query for a given page index (ex. row 10..20) and the total number of rows. I got the first part...
3
by: gopi2ks | last post by:
Dear All, I have one stored procedure like sp_insertEmployee Employee Table Fileds Eno int pk, ename varchar(100), designation varchar
12
by: Dooza | last post by:
I have a stored procedure that takes a number of inputs, does a bulk insert, and then outputs a recordset. When I run the stored procedure in Server Management Studio I also get a return value from...
6
by: SethM | last post by:
I have a stored procedure that returns a record set. I want to functionalize this so I can have multiple presentations of the same record set. However, I can not get rs_event.open StoreProc to pass...
4
by: jleeie | last post by:
Can someone help me, I'm going round in circles with this and my head is cabbaged ! I am using visual studio 2005 & VB & MS SQL 2005 I am trying to execute a stored procedure from within a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.