loganswell
Programmer
Hi,
I was sure I had this database connection thing well licked, having implemented ASP guestbooks on various web sites using dsn-less database connections. However this one has ME licked! The database is called metacart.mdb and I'm trying to access a table within it called 'orders'. It's a simple enough utility where all I want to do is dump all the records on to the screen.
Although a lot of the code is supplied "off the shelf", if I try to use THEIR coding to open the database on-line, I get the browser error as shown at the foot of this.
What am I doing wrong? Is it just something stupid?
Thanks to anyone who can help (and even to those that look but cannot!)
Regards
Jim
<%Option Explicit%>
<!-- #include file="adovbs.inc" -->
<%Dim vPath, pPath, ConnectString, conn, rsEntries, count
vPath = "database\metacart.mdb"
pPath = Server.MapPath( vPath )
ConnectString = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & pPath & ";" & "JET OLEDB
atabase Password=****"
set Conn = Server.CreateObject("ADODB.Connection"
Conn.Open ConnectString
set rsEntries = Server.CreateObject("ADODB.Recordset"
rsEntries.Open "SELECT * FROM orders " _
& Conn, adOpenDynamic, adLockPessimistic, adCmdText
while not rsEntries.EOF
%>
(password hidden)
-----THEN SOME HTML STUFF HERE---------
<%
rsEntries.Movefirst
if Request.QueryString("recordnum"
<> "" then
rsEntries.Move(Request.QueryString("recordnum"
)
end if
for count = 1 to 15%>
<b>Order ID: <%=rsEntries("orderID"
%></b><br>
<b>Order Date: <%=rsEntries("orderDate"
%>"></b><br>
<b>First Name:<%=rsEntries("fName"
%></b><br>
AND SO ON........
--------MESSAGE ON BROWSER---------
Technical Information (for support personnel)
Error Type:
ADODB.Recordset (0x800A0E7D)
The connection cannot be used to perform this operation. It is either closed or invalid in this context.
/recollections/mcartfree/_view_orders_.asp, line 23
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)
Page:
GET /recollections/mcartfree/_view_orders_.asp
Time:
08 November 2003, 14:03:53
I was sure I had this database connection thing well licked, having implemented ASP guestbooks on various web sites using dsn-less database connections. However this one has ME licked! The database is called metacart.mdb and I'm trying to access a table within it called 'orders'. It's a simple enough utility where all I want to do is dump all the records on to the screen.
Although a lot of the code is supplied "off the shelf", if I try to use THEIR coding to open the database on-line, I get the browser error as shown at the foot of this.
What am I doing wrong? Is it just something stupid?
Thanks to anyone who can help (and even to those that look but cannot!)
Regards
Jim
<%Option Explicit%>
<!-- #include file="adovbs.inc" -->
<%Dim vPath, pPath, ConnectString, conn, rsEntries, count
vPath = "database\metacart.mdb"
pPath = Server.MapPath( vPath )
ConnectString = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & pPath & ";" & "JET OLEDB
set Conn = Server.CreateObject("ADODB.Connection"
Conn.Open ConnectString
set rsEntries = Server.CreateObject("ADODB.Recordset"
rsEntries.Open "SELECT * FROM orders " _
& Conn, adOpenDynamic, adLockPessimistic, adCmdText
while not rsEntries.EOF
%>
(password hidden)
-----THEN SOME HTML STUFF HERE---------
<%
rsEntries.Movefirst
if Request.QueryString("recordnum"
rsEntries.Move(Request.QueryString("recordnum"
end if
for count = 1 to 15%>
<b>Order ID: <%=rsEntries("orderID"
<b>Order Date: <%=rsEntries("orderDate"
<b>First Name:<%=rsEntries("fName"
AND SO ON........
--------MESSAGE ON BROWSER---------
Technical Information (for support personnel)
Error Type:
ADODB.Recordset (0x800A0E7D)
The connection cannot be used to perform this operation. It is either closed or invalid in this context.
/recollections/mcartfree/_view_orders_.asp, line 23
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)
Page:
GET /recollections/mcartfree/_view_orders_.asp
Time:
08 November 2003, 14:03:53