Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBScript Runtime Error

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,2900
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> VBScript Runtime Error
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VBScript Runtime Error - 5/5/2005 3:29:54 AM   
  jonathan52988

 

Posts: 34
Score: 0
Joined: 4/12/2005
From: USA
Status: offline
Can someone help me fix the following error:

Microsoft VBScript runtime error '800a01a8'
Object required: ''
line 14

-The line adoCon.Open to ("/jon52988/db/guestbook.mdb") should be one line the forum may cut it into 2 lines.

My code:
<html>
<head>
<title> Delete </title>
</head>
<body bgcolor = "white" text = "black">
<%
Dim adoCon
Dim rsDeleteEntry
Dim strSQL
Dim IngRecordNo

lngRecordNo = CLng(Request.QueryString("ID"))
Set strSQL = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/jon52988/db/guestbook.mdb")
Set rsDeleteEntry = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM tblComments WHERE ID_no=" & "IngREcordNo"
rsDeleteEntry.LockType = 3
rsDeleteEntry.Open strSQL, adoCon
rsDeleteEntry.Delete
rsDelteEntry.Close
Set rsDelteEntry = Nothing
Set adoCon = Nothing
Response.Redirect "delete_select.asp"
%>
</body>
</html>

_____________________________

New To ASP
 
 
Post #: 1
 
 Re: VBScript Runtime Error - 5/5/2005 3:55:52 PM   
  VBS

 

Posts: 110
Score: 0
Joined: 3/2/2005
From: Lebanon
Status: offline
Dear jonathan52988
I don't see any errors in line 14, but u have some errors that might get u in trouble later:

1. This line:

      
should be:

      

2. This line:

      
Should be:

      

3. under this line:

      
add this code:

      

4. under this code:

      
add this line:

      

5. under this line:

      
put this code:

      

6. this line is written wrong:

      
should be:

      

in the end ur code will look exactly like this:


      

Hope this Helps


Best Regards

Firas S Assaad

(in reply to jonathan52988)
 
 
Post #: 2
 
 Re: VBScript Runtime Error - 5/6/2005 2:32:13 AM   
  jonathan52988

 

Posts: 34
Score: 0
Joined: 4/12/2005
From: USA
Status: offline
Thank you, VBS
I appreciate the help, but i am still getting the same error.

Microsoft VBScript runtime error '800a01a8'

Object required: ''

line 14

I fixed all the error that you told me to fix.

PS: I am pretty new to VBScript, i just learned to use VBScript about a month ago.

(in reply to jonathan52988)
 
 
Post #: 3
 
 Re: VBScript Runtime Error - 5/9/2005 12:51:48 AM   
  willem

 

Posts: 12
Score: 0
Joined: 4/25/2005
From: France
Status: offline
Your values need to be enclosed in quotes in a SELECT statement. Try this (in all select statements):

strSQL = "SELECT * FROM tblComments WHERE ID_no='" & IngREcordNo & "'"

good luck

(in reply to jonathan52988)
 
 
Post #: 4
 
 Re: VBScript Runtime Error - 5/9/2005 12:53:49 AM   
  willem

 

Posts: 12
Score: 0
Joined: 4/25/2005
From: France
Status: offline
Sorry, it doesn't render well. the first one is a single quote, followed by a double quote.
The end of the line is a single quote enclosed in double quotes.

(in reply to jonathan52988)
 
 
Post #: 5
 
 Re: VBScript Runtime Error - 5/9/2005 7:13:24 AM   
  VBS

 

Posts: 110
Score: 0
Joined: 3/2/2005
From: Lebanon
Status: offline
Dear willem,
The ID_no is a number field, so if u put the qouts, it will give him a new error

so it should be like this
strSQL = "SELECT * FROM tblComments WHERE ID_no=" & IngREcordNo

(in reply to jonathan52988)
 
 
Post #: 6
 
 Re: VBScript Runtime Error - 5/10/2005 3:20:26 AM   
  jonathan52988

 

Posts: 34
Score: 0
Joined: 4/12/2005
From: USA
Status: offline
Actually when i completely removed the quotes i received an error. Mr. Token found the error. It was Set strSQL = Server.CreateObject("ADODB.Connection") should of been Set adoCon = Server.CreateObject("ADODB.Connection")

but now i have run into another error
Too Few Parameter Explicit 1.

(in reply to jonathan52988)
 
 
Post #: 7
 
 Re: VBScript Runtime Error - 5/10/2005 5:18:11 AM   
  VBS

 

Posts: 110
Score: 0
Joined: 3/2/2005
From: Lebanon
Status: offline
what line??

(in reply to jonathan52988)
 
 
Post #: 8
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> VBScript Runtime Error Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts