I have created a VB .dll file that accesses a database and returns all of the records within a given table. The function works as I have tested it successfully inside of a separate VB app.
Now, I am trying to instantiate this inside of an ASP page and simply show the records on the screen. However, I keep receiving an error message and it will not run. The error appears to be where I'm calling the specific function (recordset) and then trying to use it's properties/methods. It doesn't appear to recognise the recordset and thus returns no data. Furthermore, it halts running any further code after that point (HTML or otherwise). Below is a copy of my ASP code, can anyone see the problem? (Incidentally, this code is copied directly out of ASP 3.0 book by Wrox Press - so it should work.)
<%@ Language=VBScript TRANSACTION=Required %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<FORM ID="frmOrder" NAME="frmOrder" ACTION="PlaceOrder.asp" METHOD="Post">
<BLOCKQUOTE>
<H3>
To generate an order enter in your first name, last name,
the quantity, and select a product to purchase.
</H3>
<HR>
<BR>
First Name:
<BR>
<INPUT TYPE="text" ID="txtFN" NAME="txtFN">
<P>
Last Name:
<BR>
<INPUT TYPE="text" ID="txtLN" NAME="txtLN">
<P>
Products:
<BR>
<SELECT ID="optProducts" NAME="optProducts">
<%
dim objASPTrans, rsProducts
set objASPTrans = server.CreateObject("ASPTrans.Products"
rsProducts = objASPTrans.GetProducts
do until rsProducts.eof
Response.Write "<OPTION VALUE=" & rsProducts("id"
& _
">" & rsProducts("name"
& vbCrLf
rsProducts.movenext
loop
set rsProducts = nothing
set objASPTrans = nothing
%>
</SELECT>
<P>
Quantity:
<BR>
<INPUT TYPE="text" ID="txtQuantity" NAME="txtQuantity">
<P>
<INPUT TYPE="submit" VALUE="Place Order" ID="btnPlaceOrder" NAME="btnPlaceOrder">
</BLOCKQUOTE>
</FORM>
</BODY>
</HTML>
Now, I am trying to instantiate this inside of an ASP page and simply show the records on the screen. However, I keep receiving an error message and it will not run. The error appears to be where I'm calling the specific function (recordset) and then trying to use it's properties/methods. It doesn't appear to recognise the recordset and thus returns no data. Furthermore, it halts running any further code after that point (HTML or otherwise). Below is a copy of my ASP code, can anyone see the problem? (Incidentally, this code is copied directly out of ASP 3.0 book by Wrox Press - so it should work.)
<%@ Language=VBScript TRANSACTION=Required %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<FORM ID="frmOrder" NAME="frmOrder" ACTION="PlaceOrder.asp" METHOD="Post">
<BLOCKQUOTE>
<H3>
To generate an order enter in your first name, last name,
the quantity, and select a product to purchase.
</H3>
<HR>
<BR>
First Name:
<BR>
<INPUT TYPE="text" ID="txtFN" NAME="txtFN">
<P>
Last Name:
<BR>
<INPUT TYPE="text" ID="txtLN" NAME="txtLN">
<P>
Products:
<BR>
<SELECT ID="optProducts" NAME="optProducts">
<%
dim objASPTrans, rsProducts
set objASPTrans = server.CreateObject("ASPTrans.Products"
rsProducts = objASPTrans.GetProducts
do until rsProducts.eof
Response.Write "<OPTION VALUE=" & rsProducts("id"
">" & rsProducts("name"
rsProducts.movenext
loop
set rsProducts = nothing
set objASPTrans = nothing
%>
</SELECT>
<P>
Quantity:
<BR>
<INPUT TYPE="text" ID="txtQuantity" NAME="txtQuantity">
<P>
<INPUT TYPE="submit" VALUE="Place Order" ID="btnPlaceOrder" NAME="btnPlaceOrder">
</BLOCKQUOTE>
</FORM>
</BODY>
</HTML>