:: Forum >> Version 1 >>

ActiveWidgets with SQL Server

can i use the ActiveWidgets to display my data from the table in SQL server or can i connect ActiveWidgets to any other database and display the data in grid?
Anyone please help!!
Thank you very much
Gemini
Thursday, December 23, 2004
Yes, you can. But you need either a server side script to query the database. ActiveWidgets is strictly a client side script.

I found I can easily dump a query result set into the Grid using ColdFusion and MySQL. Using SQL Server would be just as easy.
Don Smith
Wednesday, January 5, 2005
Thank you Don Smith!
can you give me some guide on how to dump a query result set into the Grid? i am using the JSP.

Thank you
Gemini
Wednesday, January 19, 2005
Create a client-side javascript array which contains the data returned from your query to the database.
Wednesday, January 26, 2005
I believe Gemini has the same problem as I do. I know how to do that using VBScript, but I'm puzzled about doing it with JS. So, I think that a little bit of source code will be appreciated.

Thanks,

Seca
Seca
Thursday, January 27, 2005
See http://www.activewidgets.com/documentation/tutorial/grid/data-xmlsimple.htm . This retrieves an XML document from the web server. In your server-side code, simply query the sql server and return an XML document. You could basically just copy the javascript that exists in that example and change appropriately to point to your server-side page that retrieves the data from the server.

We actually don't even bother with creating an XMLDoc, we simply simply return a dataset through a web service (ASP.NEt and c#) and then use XPath to appropriately refer to the fields.
Alex (not ActiveWidgets)
Thursday, January 27, 2005
the link isn't there?
needit
Friday, March 18, 2005
Here is the simplest example to get you started. You just need to change the ODBC connection and table information to match yours.
------------------------------------

<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
<html>
<head>
<style>
body, html {margin:0px; padding: 0px; overflow: hidden;font: menu;border: none;} </style>
<link href="../../runtime/styles/xp/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- #INCLUDE FILE="activewidgets.asp" -->
</head>
<body>

<%
Dim oConnection, oRecordset
Set oConnection = Server.CreateObject("ADODB.Connection")
oConnection.Open "IntranetSQL"
Set oRecordset = oConnection.Execute("SELECT * FROM Employees")

Response.write(activewidgets_grid("obj", oRecordset))

'Alternate method via recordset
'do while not oRecordset.eof
'str = str & oRecordset("FirstName") & "," & oRecordset("LastName") & vbCrlf
'movenext
'loop

oRecordset.close
Set oRecordset = nothing
oConnection.close
Set oConnection = nothing
%>

</body>
</html>
Jorge
Friday, August 26, 2005
Does anyone know what the "include" file he is putting in the above example?
Brian
Saturday, November 11, 2006



This topic is archived.

Back to support forum

Forum search