Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 23rd, 2004, 06:49 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft VBScript runtime error '800a01a8'

Hi Everyone,

I am very new to asp and i have a recurring problem thats giving me grief. I am trying to display data from three tables in an MS Access database. Here is my code:-

<html>
<head>
<title>Magazine Orders</title>
</head>
<body background="backg8.jpg" bgproperties=fixed>
<table border="1">
<tr>
<td colspan=7 align=center>Magazine Orders</td>
</tr>
<tr>
<th>Customer Name</th>
<th>E-mail</th>
<th>Telephone Number</th>
<th>Magazine Issue Number</th>
<th>Caption</th>
</tr>


<%
dim con, Rs
dim t1,t2,t3,t4,t5, Sqlquery

set con=server.createObject("ADODB.Connection")

con.open "name"

Sqlquery = "SELECT Customers.CUS_NAME, Customers.EMAIL, Customers.PHONE_NUMBER, Magazines.ISSUE_NO, Magazines.CAPTION" &_
"FROM Magazines INNER JOIN (Customers INNER JOIN Customers_Magazines ON Customers.CUS_ID = Customers_Magazines.CUS_ID) ON Magazines.ISSUE_NO = Customers_Magazines.ISSSUE_NO" &_

set Rs = Con.Execute( Sqlquery )

%>








<%
while not Rs.EOF

t1=Rs("CUS_NAME")
t2=Rs("EMAIL")
t3=Rs("PHONE_NUMBER")
t4=Rs("ISSUE_NO")
t5=Rs("CAPTION")




Response.Write "<TR><TD>" & (t1) & "</TD>"
Response.Write "<TD>" & (t2) & "<TD>"
Response.Write "<TD>" & (t3) & "<TD>"
Response.Write "<TD>" & (t4) & "<TD>"
Response.Write "<TD>" & (t5) & "<TD><TR>"

Rs.MoveNext

Wend
Rs.close
Con.close
set Rs=nothing
Set Con=nothing
%>
</table>
</body>
</html>

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

I get this error:

--------------------------------------------------------------------
Microsoft VBScript compilation error '800a03ea'

Syntax error

/name/view_mag_ord.asp, line 30

set Rs = Con.Execute( Sqlquery )
^
-------------------------------------------------------------------------

i've had this problem before, played with the asp and get other errors. its just a vicious cycle of errors. its getting really frustating now. i need help!!!

i am thinking the problem is not with the line in question but somewhere else. Can someone please be kind enough to cross-check my code and make suggestions? Thanks in advance.



Reply With Quote
  #2 (permalink)  
Old January 24th, 2004, 04:48 AM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't usually use the Execute method, but rather the Open method of the recordset object. But my gut tells me you don't have enough info to open the connection. For Jet databases, you need to specify the location of the database on the harddrive, either through an absolute reference, or using Server.Mappath. Here is an example connection to an Access database from my world...

Set cnXN = Server.CreateObject("ADODB.Connection")cnXN.Connec tionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\INetPub\wwwsites\MyWebsite\datasrc\MyWeb site.mdb"
cnXN.Open

Start with that. Then I'd look at my ADO command:

  Set cmd = Server.CreateObject("ADODB.Command")
  cmd.CommandType=adCmdText
  Set cmd.ActiveConnection = cnXN
  cmd.CommandText = "YOUR SQL QUERY GOES HERE"
  cmd.Execute

Or you could use the open method of the recordset object, as in

Set Rs= Server.CreateObject ("ADODB.RecordSet")
Rs.Open "YOUR SQL QUERY GOES HERE", cnXN, adOpenKeyset, adLockOptimistic

The last 2 properties determine what kind of cursor and reocordlocking you use. There are four options for each. You can get more info online.

Good luck!

Reply With Quote
  #3 (permalink)  
Old January 24th, 2004, 05:00 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

I think this is causing the problem:

ISSSUE_NO" &_
set Rs = Con.Execute( Sqlquery )


Why are you using the underscore to connect the Rs line with the previous line?

Also, make sure your query is OK,. Before you execute the query, use Response.Write to send it to the browser, and then copy and paste it in your database and see if it runs there.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #4 (permalink)  
Old January 25th, 2004, 05:15 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thank you very much for your suggestion. It solved the problem.

Cheers


Quote:
quote:Originally posted by Imar
 I think this is causing the problem:

ISSSUE_NO" &_
set Rs = Con.Execute( Sqlquery )


Why are you using the underscore to connect the Rs line with the previous line?

Also, make sure your query is OK,. Before you execute the query, use Response.Write to send it to the browser, and then copy and paste it in your database and see if it runs there.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #5 (permalink)  
Old January 25th, 2004, 05:18 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi everyone,

Thanks for your suggestions to my topic. Imar's reply solved the main part of the problem, and my sql query didn't have a space before the "From" clause.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBScript runtime error '800a01a8' - FIXED buddyz Classic ASP Databases 2 September 13th, 2006 10:55 AM
Microsoft VBScript runtime error '800a01a8' Abbas Classic ASP Basics 1 July 21st, 2006 11:43 AM
Microsoft VBScript runtime error '800a01a8' Abbas Classic ASP Professional 1 July 21st, 2006 11:42 AM
Microsoft VBScript runtime error '800a01a8' object stevesole Access ASP 9 June 7th, 2004 08:13 PM
Microsoft VBScript runtime error '800a01a8' gmoney060 BOOK: Beginning ASP 3.0 1 June 2nd, 2004 01:18 PM



All times are GMT -4. The time now is 06:24 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.