 |
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

January 19th, 2005, 06:51 PM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Database Connection Error
Newb in trouble!
I would like for this page to display certain fields of my access database but seem to be stuck!
I receive the following error whrn trying to connect to my database
ADODB.Recordset error '800a0e7d'
The connection cannot be used to perform this operation. It is either closed or invalid in this context.
[path]/asp/dbman/search1.asp, line 8
Any help would be appreciated
Code:
<%@Language = "VbScript"%>
<%
dim objConn,objRec
set objConn=Server.CreateObject("ADODB.Connection")
objConn.Provider="Microsoft.Jet.OLEDB.4.0"
objConn.Open "[path]//asp/temp/toast/data/cap.mdb"
Set objRec = Server.CreateObject ("ADODB.Recordset")
objRec.Open "member"
While NOT objRec.EOF
Response.Write objRec("ID") & ", "
Response.Write objRec("Fname") & ", "
Response.Write objRec("LName") & ", "
Response.Write objRec("Uname") & "<BR>"
objRec.MoveNext
Wend
%>
<HTML>
<HEAD>
</HEAD>
<Body>
</Body>
</HTML>
Thanks
|

January 19th, 2005, 09:02 PM
|
Friend of Wrox
|
|
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi,
Invalid arguments in the recordset open
Set objRec = Server.CreateObject ("ADODB.Recordset")
objRec.Open "member",objConn
-----------
Rajani
|

January 20th, 2005, 12:20 PM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks a bunch i am able to get into the script now but im receivinq an SQL error
Microsoft JET Database Engine error '80040e14'
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.
Thoughts?
|

January 20th, 2005, 12:24 PM
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Try setting the options parameter to adCmdTable...
Code:
objRec.Open "member", objConn, , , adCmdTable
HTH,
Chris
|

January 20th, 2005, 12:27 PM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for a quick response
I tried inputting this string but receive the same error thought?
|

January 20th, 2005, 12:36 PM
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Have you referenced the ado constants in your page?
|

January 20th, 2005, 12:46 PM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Oops I had not but now that I have I get the following error
Microsoft JET Database Engine error '80040e14'
Syntax error in FROM clause.
[path]/Hot Topic.asp, line 14
The database was made from a comma delimited text document it is only a test database it was converted with access 2002
|

January 20th, 2005, 01:14 PM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
OK I created a new database with access but i am still getting this error
Microsoft JET Database Engine error '80040e14'
Syntax error in FROM clause.
[path]/Hot Topic.asp, line 14
here is my code line 14(objRec.Open "Hot%20topic",objConn, , , adCmdTable) seems to be the trouble?
Code:
<HTML>
<HEAD>
</HEAD>
<Body>
<%@Language = "VbScript"%>
<%
dim objConn,objRec
set objConn=Server.CreateObject("ADODB.Connection")
objConn.Provider="Microsoft.Jet.OLEDB.4.0"
objConn.Open "[path]/hot topics.mdb"
Set objRec = Server.CreateObject ("ADODB.Recordset")
objRec.Open "Hot%20topic",objConn, , , adCmdTable
While NOT objRec.EOF
Response.Write objRec("ID") & ", "
Response.Write objRec("Date") & ", "
Response.Write objRec("Control") & ", "
Response.Write objRec("Company") & ", "
Response.Write objRec("Comments") & "<BR>"
objRec.MoveNext
Wend
%>
</Body>
</HTML>
|

January 20th, 2005, 01:20 PM
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Do you have a table in your database called "Hot%20topic"?
|

January 20th, 2005, 01:28 PM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yes it is called Hot Topic but when I leave out the %20 it says no query or table found named "Hot"
I assumed I spelled a field wrong but they are all correct!
Thoughts
|
|
 |