Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

another connection problem :-(

Status
Not open for further replies.

loganswell

Programmer
Dec 28, 2000
111
GB
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=&quot;adovbs.inc&quot; -->
<%Dim vPath, pPath, ConnectString, conn, rsEntries, count

vPath = &quot;database\metacart.mdb&quot;
pPath = Server.MapPath( vPath )

ConnectString = &quot;PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=&quot; & pPath & &quot;;&quot; & &quot;JET OLEDB:Database Password=****&quot;

set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Conn.Open ConnectString

set rsEntries = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsEntries.Open &quot;SELECT * FROM orders &quot; _
& Conn, adOpenDynamic, adLockPessimistic, adCmdText
while not rsEntries.EOF

%>

(password hidden)

-----THEN SOME HTML STUFF HERE---------

<%
rsEntries.Movefirst

if Request.QueryString(&quot;recordnum&quot;) <> &quot;&quot; then
rsEntries.Move(Request.QueryString(&quot;recordnum&quot;))
end if

for count = 1 to 15%>
<b>Order ID: <%=rsEntries(&quot;orderID&quot;)%></b><br>
<b>Order Date: <%=rsEntries(&quot;orderDate&quot;)%>&quot;></b><br>
<b>First Name:<%=rsEntries(&quot;fName&quot;)%></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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top