Here's the scenario.

I have a web server running with IIS 6 and website running written in ASP.

The site and code has been working perfectly up until about 2 days ago when for no reason whatsoever the ASP has decided to partly work.

and by this i mean as follows

<option value="<%response.write infotable("gigday")%>"><%= infotable("gigday")%></option>

The section that is in bold i.e the first response.write infotable works. The value from the table is written to the HTML and can be viewed in the source, however the second response.write outputs nothing. I have replaced the = for the wording response.write and this still doesn't work.

the code itself actually sits in a loop that reads the contents of a database and outputs data from the database. The connection string is fine.

in fact if you like throught the web site then you will find that the asp code only works in certain places even though 2 days prior it was all working correctly.

I've re-installed mysql, checked the disk, ran ant-virus check but still no joy

if you want to see this in action then visit www.thedemopage.com and look throught it.

cheers
craig

Recommended Answers

All 5 Replies

here's an update....

<%
strConnection = "driver={MySQL ODBC 3.51 Driver};server=localhost;uid=*****;password=*****;database=******"
Set adoDataConn = Server.CreateObject("ADODB.Connection") 
adoDataConn.Open strConnection
set batable = adoDataConn.execute("Select * from thedemopage.bands order by viewcount desc limit 10")
do until (batable.eof )
response.write batable("band") & "1<br>"
response.write batable("band") & "2<br>"
response.write batable("band") & "3<br>"
response.write batable("band") & "4<br>"
batable.movenext
loop
%>

Line 1 is the only one that displays data from the database. 2, 3 and 4 only display the numbers and not the data from the database.

however on the next cycle throught the loop the next band is displayed. This is the output. (2, 3 and four should display the band name as well.

hazzadj1
2
3
4
FINGER AND THUMB1
2
3
4
eltest1
2
3
4
digitanz1
2
3
4
voodoo mutha fuckers1
2
3
4
Textures1
2
3
4


help


Craig

<%
strConnection = "driver={MySQL ODBC 3.51 Driver};server=localhost;uid=*****;password=*****;database=******"
Set adoDataConn = Server.CreateObject("ADODB.Connection")
adoDataConn.Open strConnection
set batable = adoDataConn.execute("Select * from thedemopage.bands order by viewcount desc limit 10")
do until (batable.eof )
response.write batable("band") & "1<br>"
response.write batable("band") & "2<br>"
response.write batable("band") & "3<br>"
response.write batable("band") & "4<br>"
batable.movenext
loop
%>

I've seen crazy stuff like this before.
Try this query:

set batable = adoDataConn.execute("Select bands.band from bands order by viewcount desc limit 10")
dim bandName
do while not batable.eof
[INDENT]bandName = Cstr(batable("band"))
response.write(bandName)
bandName="" 'to ensure we don't repeat the same value
batable.movenext[/INDENT]
loop

I've seen weird things and only have been able to fix them by casting into a strong type, hence the Cstr type cast. Also, using a local variable first, then displaying the variable has also solved some very weird behavior. I work with asp on a daily basis and I can attest to some VERY strange behavior from ASP.

Many thanks for your reply, However, the website currently has 67+pages and I can't really afford to go through and reprogramme everything.

if the worst comes tot he worst then I might un-installa dn re-install IIS or even rebuild the server from scratch.

but I will try what you have suggested and see what happens.

well, i tested your suggestion and as suspected that worked fine. In fact I have a php version of the site i'm working on and guess what works still - the php version.

So, I suspect it's either iis, the asp dll or the metabase file has become corrupted sooooo, it looks like i might either attempt to uninstalla nd re-install iis and test that but I will definitely be going the way of php. i'll post my findings..

I'd use either php or ASP.NET. I've lost any hope in classic ASP over the years . :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.