ASP - DNS - Run Time Error

M

MadMike42

Hi,
Ive got a web site hosted on Seem (www.seem.co.uk)
it allows 1 Access Database and you can connect via DSN

I have a message that scrolls across the top of the page,
it can work, refresh, work, refresh, fail, refresh, work, etc etc
I dont have any control of the permissions, web server etc
just my code and database file.
I can see any reason why it will work 4 out of 5 times.
Any thoughts ?

To open the database I use:-
Open Data (Include) Page:-
<%
Set cnn = Server.Createobject("ADODB.Connection")
cnn.open "DSN=gtr"
session.lcid=2057
%>

The error message:-
Error Type:
(0x80020009)
Exception occurred.
/gtr/main_scroll.asp, line 15

Scroll Page Code :-
<marquee direction='left' delay=100>
<%
dim MyMsg
set rsTable=server.createobject ("adodb.recordset")
sql="Select * from CarStock where carstatus=0"
rsTable.open sql,cnn,3,3
if rsTable.eof=false then
rsTable.movelast
RecCount=rsTable.recordcount
Randomize(timer)
MyNum=Int(Rnd * RecCount) + 1
rsTable.movefirst
rsTable.move(MyNum)
MyMsg="<div id='ScrollMessage'><BR>"
MyMsg=MyMsg & rsTable("Make") & ", " <----------- Line 15
MyMsg=MyMsg & rsTable("Model") & " , "
MyMsg=MyMsg & rsTable("RegLetter") & ", "
MyMsg=MyMsg & rsTable("Reg") & ", "
MyMsg=MyMsg & "£" & formatnumber(rsTable("Sell"),2) & ", "
MyMsg=MyMsg & "Colour:" & rsTable("Colour") & ", "
MyMsg=MyMsg & "Mileage:" & rsTable("Mileage") & ", "
MyMsg=MyMsg & rsTable("SellNotes")
MyMsg=MyMsg & "</div>"
response.write MyMsg
else
Response.write ". . . please call for a full stock list . . ."
end if
rsTable.close
set rsTable=Nothing
%></marquee>
 
M

Mike Brind

MadMike42 said:
Hi,
Ive got a web site hosted on Seem (www.seem.co.uk)
it allows 1 Access Database and you can connect via DSN

I have a message that scrolls across the top of the page,
it can work, refresh, work, refresh, fail, refresh, work, etc etc
I dont have any control of the permissions, web server etc
just my code and database file.
I can see any reason why it will work 4 out of 5 times.
Any thoughts ?

To open the database I use:-
Open Data (Include) Page:-
<%
Set cnn = Server.Createobject("ADODB.Connection")
cnn.open "DSN=gtr"
session.lcid=2057
%>

The error message:-
Error Type:
(0x80020009)
Exception occurred.
/gtr/main_scroll.asp, line 15

Scroll Page Code :-
<marquee direction='left' delay=100>
<%
dim MyMsg
set rsTable=server.createobject ("adodb.recordset")
sql="Select * from CarStock where carstatus=0"
rsTable.open sql,cnn,3,3
if rsTable.eof=false then
rsTable.movelast
RecCount=rsTable.recordcount
Randomize(timer)
MyNum=Int(Rnd * RecCount) + 1
rsTable.movefirst
rsTable.move(MyNum)
MyMsg="<div id='ScrollMessage'><BR>"
MyMsg=MyMsg & rsTable("Make") & ", " <----------- Line 15
MyMsg=MyMsg & rsTable("Model") & " , "
MyMsg=MyMsg & rsTable("RegLetter") & ", "
MyMsg=MyMsg & rsTable("Reg") & ", "
MyMsg=MyMsg & "£" & formatnumber(rsTable("Sell"),2) & ", "
MyMsg=MyMsg & "Colour:" & rsTable("Colour") & ", "
MyMsg=MyMsg & "Mileage:" & rsTable("Mileage") & ", "
MyMsg=MyMsg & rsTable("SellNotes")
MyMsg=MyMsg & "</div>"
response.write MyMsg
else
Response.write ". . . please call for a full stock list . . ."
end if
rsTable.close
set rsTable=Nothing
%></marquee>

Assume you have 10 records.
Assume also that MyNum = 10.
Now MoveFirst.
Which record are you at?
Record 1.
Now .move(myNum) [10 places]
Which record are you pointing at now?
Now try to read a value from Record 11.

Exception ocurred.
 
M

MadMike42

Doh !
Never thought of that
Thanks
Mike.

Mike Brind said:
MadMike42 said:
Hi,
Ive got a web site hosted on Seem (www.seem.co.uk)
it allows 1 Access Database and you can connect via DSN

I have a message that scrolls across the top of the page,
it can work, refresh, work, refresh, fail, refresh, work, etc etc
I dont have any control of the permissions, web server etc
just my code and database file.
I can see any reason why it will work 4 out of 5 times.
Any thoughts ?

To open the database I use:-
Open Data (Include) Page:-
<%
Set cnn = Server.Createobject("ADODB.Connection")
cnn.open "DSN=gtr"
session.lcid=2057
%>

The error message:-
Error Type:
(0x80020009)
Exception occurred.
/gtr/main_scroll.asp, line 15

Scroll Page Code :-
<marquee direction='left' delay=100>
<%
dim MyMsg
set rsTable=server.createobject ("adodb.recordset")
sql="Select * from CarStock where carstatus=0"
rsTable.open sql,cnn,3,3
if rsTable.eof=false then
rsTable.movelast
RecCount=rsTable.recordcount
Randomize(timer)
MyNum=Int(Rnd * RecCount) + 1
rsTable.movefirst
rsTable.move(MyNum)
MyMsg="<div id='ScrollMessage'><BR>"
MyMsg=MyMsg & rsTable("Make") & ", " <----------- Line 15
MyMsg=MyMsg & rsTable("Model") & " , "
MyMsg=MyMsg & rsTable("RegLetter") & ", "
MyMsg=MyMsg & rsTable("Reg") & ", "
MyMsg=MyMsg & "£" & formatnumber(rsTable("Sell"),2) & ", "
MyMsg=MyMsg & "Colour:" & rsTable("Colour") & ", "
MyMsg=MyMsg & "Mileage:" & rsTable("Mileage") & ", "
MyMsg=MyMsg & rsTable("SellNotes")
MyMsg=MyMsg & "</div>"
response.write MyMsg
else
Response.write ". . . please call for a full stock list . . ."
end if
rsTable.close
set rsTable=Nothing
%></marquee>

Assume you have 10 records.
Assume also that MyNum = 10.
Now MoveFirst.
Which record are you at?
Record 1.
Now .move(myNum) [10 places]
Which record are you pointing at now?
Now try to read a value from Record 11.

Exception ocurred.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top