If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > strange error message

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-05-04, 05:16
davep23 davep23 is offline
Registered User
 
Join Date: Dec 2003
Location: Brisbane
Posts: 14
strange error message

I keep getting this strange error message with the following script. I am trying to access data from a database and write it to a webpage. I am using SunOne ASP.

########
ERROR MESSAGE:
########
Error Type:
Sun ONE ASP VBScript runtime (0x800A01AE)
Class does not support automation
/testing1.asp, line 11

########
SCRIPT:
########
<% @ Language="VBScript" %>
<% Option Explicit %>
<%
Dim PeopleRS, sConnString, myConn, mySQL
Set myConn= server.CreateObject("ADODB.Connection")
sConnString="DSN=database1"
myConn.Open sConnString
mySQL = "Select * from People"
Set PeopleRS = myConn.Execute(mySQL)
Response.Write "<table>"
do while not PeopleRS
Response.Write "<tr>"
Response.Write "<td>" & PeopleRS("ID").value & "</td>"
Response.Write "<td>" & PeopleRS("People").value & "</td>"
Response.Write "<td>" & PeopleRS("Comment").value & "</td>"
Response.Write "</tr>"
PeopleRS.MoveNext
loop
Response.Write "</table>"
Set PeopleRS = nothing
Set myConn = nothing
%>
Reply With Quote
  #2 (permalink)  
Old 02-05-04, 06:25
davep23 davep23 is offline
Registered User
 
Join Date: Dec 2003
Location: Brisbane
Posts: 14
New Error Message

Now I'm getting the following error message:

Error Type:
ADODB.Connection.1 (0x80004005)
SQLState: S1000 Native Error Code: -1045 [DataDirect][ODBC SequeLink driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Not a valid bookmark.
/testing1.asp, line 7

Last edited by davep23; 02-05-04 at 06:29.
Reply With Quote
  #3 (permalink)  
Old 02-05-04, 19:11
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
What is the difference between SunOne ASP and MS ASP?
Reply With Quote
  #4 (permalink)  
Old 02-05-04, 20:00
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
for your first error wouldn't you need to change line 11 to

do while not PeopleRS.eof
??

As for the second, did you change anything in the code to cause that??
Reply With Quote
  #5 (permalink)  
Old 02-05-04, 21:17
CodeMan CodeMan is offline
Registered User
 
Join Date: Feb 2004
Posts: 1
Do what rokslide says

"do while not PeopleRS.eof"

then,

Try creating the recordset object after this line:

Set myConn= server.CreateObject("ADODB.Connection")

Set PeopleRS = server.CreateObject("ADODB.Recordset")

Then after you create the SQL statement, you can:

Set PeopleRS = myConn.Execute(mySQL)

Also, it is more efficient to select exactly what you want not '*'.

mySQL = "Select ID, People, Comment From People"

Last edited by CodeMan; 02-05-04 at 21:19.
Reply With Quote
  #6 (permalink)  
Old 02-06-04, 23:04
davep23 davep23 is offline
Registered User
 
Join Date: Dec 2003
Location: Brisbane
Posts: 14
changes to the code

Made the necessary changes to the code. Now I'm getting an error message relating to line 8

Error Type:
ADODB.Connection.1 (0x80004005)
SQLState: S1000 Native Error Code: -1045 [DataDirect][ODBC SequeLink driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Not a valid bookmark.
/testing1.asp, line 8
Reply With Quote
  #7 (permalink)  
Old 02-10-04, 07:10
davep23 davep23 is offline
Registered User
 
Join Date: Dec 2003
Location: Brisbane
Posts: 14
Come on guys... help me out...

Come on guys... help me out... I'm just about to give up! Any suggestions?
Reply With Quote
  #8 (permalink)  
Old 02-10-04, 17:28
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Sorry, can't help you with that one dude, I have never seen the error message before.

Is line 8 the connect line or the query line??

If it is the connect line check you ODBC/DSN details, otherwise check your database and made sure your table is correct.
Reply With Quote
  #9 (permalink)  
Old 04-29-09, 01:12
uttamtakalkar uttamtakalkar is offline
Registered User
 
Join Date: Apr 2009
Posts: 3
Have you got the solution

Hello,

If you got the solution for your above problem please let me know.
i am getting the same error
Reply With Quote
  #10 (permalink)  
Old 04-29-09, 03:38
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
You don't generally execute a recordset (SELECT statement), instead you Open() instead.

Also, your loop should read
Code:
do while not PeopleRS.EOF
...
Try this and let us know how you get on.
__________________
George
Twitter | Blog
Reply With Quote
  #11 (permalink)  
Old 04-29-09, 03:52
uttamtakalkar uttamtakalkar is offline
Registered User
 
Join Date: Apr 2009
Posts: 3
Thanks Dear

Thanks a lot,
its working now
Thanks again
Reply With Quote
  #12 (permalink)  
Old 04-29-09, 04:19
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Can you tell us exactly what you did to fix the issue?

It will benefit all future readers of the thread to have a final answer!
__________________
George
Twitter | Blog
Reply With Quote
  #13 (permalink)  
Old 04-29-09, 05:15
uttamtakalkar uttamtakalkar is offline
Registered User
 
Join Date: Apr 2009
Posts: 3
before I have declared variable like below:
set Rs=Server.CreateObject("ADODB.RecordSet")

Now i changed it to simply
set Rs=con.Execute(Sql)

and it worked
thanks
Reply With Quote
  #14 (permalink)  
Old 05-04-09, 06:02
saxenaa.vishall saxenaa.vishall is offline
Registered User
 
Join Date: May 2009
Posts: 1
how to store and retrieve hindi data in sqlserver 2005? if anyone can suggest plz reply...
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On