Ascx page in html to connect to sql db and show results on page

Good day, I looked at a previous post.

I have an ascx page on a web application that i want to edit by displaying information from a sql db. I don't know asp.net & would like to link using server side vbscript.
Below is the code from page & code from previous post to connect to DB.

<!--<%@ Control Language="c#" AutoEventWireup="True" Codebehind="Header.ascx.cs" Inherits="FlowCentric.Net.Navigator.Header" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>-->

<%@ LANGUAGE="VBScript"%>
<% Option Explicit %>
<script src="../../runtime/lib/grid.js"></script>
Dim oConnection, oRecordset
Set oConnection = Server.CreateObject("ADODB.Connection")
oConnection.Open "data source=sqlserver;initial catalog=Test;user id=Test; password=Test"
Set oRecordset = oConnection.Execute("select Description from fcRole where ID = 61")

Response.write(activewidgets_grid("obj", oRecordset))
'Alternate method via recordset
'do while not oRecordset.eof
'str = str & oRecordset("FirstName") & "," & oRecordset("LastName") & vbCrlf

Set oRecordset = nothing
Set oConnection = nothing
<!--<table width="100%" cellpadding="0" cellspacing="0" height="96px">
<tr><td> <asp:Label id="lblLogin" runat="server">Welcome</asp:Label> </td></tr>

I keep on getting an error at "<%@ LANGUAGE="VBScript"%>" and know i will get more after that line.

Please help - struggling for days.

April 16,

This topic is archived.

See also:

Back to support forum