473,386 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

VERY odd classic ASP problem on 2005 upgrade

I'm seeing a VERY odd issue after moving my data from a SQL2000 DB to
a SQL2005 DB. About half the time, when I request a value (using
ors.fields("pagedata") for instance), I get nothing returned. I know
there's data in the field, and I'm on the correct RS object.

Sometimes, when I move the call to another portion of the page, I get
the data (while on the same RS object). I need to move to a new server
running 2005, and folks are starting to chomp at me. Help! I've never
seen anything vaguely like this.

Thanks,

Elliott Roberts

Mar 27 '07 #1
3 1754
Elliott Roberts wrote:
I'm seeing a VERY odd issue after moving my data from a SQL2000 DB to
a SQL2005 DB. About half the time, when I request a value (using
ors.fields("pagedata") for instance), I get nothing returned. I know
there's data in the field, and I'm on the correct RS object.

Sometimes, when I move the call to another portion of the page, I get
the data (while on the same RS object). I need to move to a new server
running 2005, and folks are starting to chomp at me. Help! I've never
seen anything vaguely like this.
I don't know how you expect us to help you. Show us some code to allow us to
reproduce your problem.

As a guess, could it be this old ODBC bug?
http://www.aspfaq.com/show.asp?id=2188

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Mar 27 '07 #2
On Mar 27, 6:06 pm, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
I don't know how you expect us to help you. Show us some code to allow us to
reproduce your problem.

As a guess, could it be this old ODBC bug?http://www.aspfaq.com/show.asp?id=2188
Sorry for the lack of detail - I thought it might be a common
weirdness with an upgrade like this. Guess not. The code ran like a
Swiss watch against a 2000 server (and still does). It is very long,
and well, not all that well written. Sadly, I need this to work
against 2005 without re-coding the whole thing. Here's a sample that
contains relevant parts:

connectionstring = "Driver={SQL Native
Client};Server=x.x.x.x;Database=distweb;Uid=xxx;Pw d=xxx;MARS_Connection=yes;"
Set oC = Server.CreateObject("ADODB.Connection")
oC.Open connectionstring
Set oRS = Server.CreateObject("ADODB.Recordset")
sqlStr = "SELECT * FROM pagedata WHERE pageid = " & int(pageid) & "
and pid = " & int(pid) & " AND folder = '" & application("varfolder")
& "' order by rank, id"
set oRS = oC.execute(sqlSTR)

' If there are no paragraphs created, then display an under
construction notice
IF ors.EOF THEN
Response.Write("<CENTER><B>This section is not yet complete.</B></
CENTER><BR>")
ELSE
' Loop through the available paragraphs
DO WHILE not ORS.EOF

' If the pagedata is a header, print it...else, go to the paragraph
section
IF ors.fields("header") = true THEN
BuildHeader(ors.fields("pagedata"))
ELSE
'Image
IF ors.fields("image") <"" THEN
%>
<IMG SRC="/<%=ors.fields("image")%>" ALIGN=<
%=ors.fields("imagealign")%>>

<img alt="" src="spacer.gif" height="0" align="left" width="1">
<%
END IF
'Check to see if this is a title
vt = ors.fields("title")
IF vt <"" THEN
%>
<B><%=vt%></B><BR>
<%
END IF
Response.write(ors.fields("pagedata") & "<BR><BR>")
if ors.fields("imgcap") <"" then
%>
<div style="width:100%; text-align:<
%=ors.fields("imagealign")%>"><table align="<%=ors.fields("imagealign")
%>"><tr><td align="left" style="font-size:7pt;"><%=ors.fields("imgcap")
%></td></tr></table></div>
<%
end if
END IF 'IF header

ors.MoveNext
loop
END IF

oRS.Close
set oRS = nothing
oC.close
Set oC = nothing

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

Thanks for any help.

Elliott

Mar 28 '07 #3
Elliott Roberts wrote:
On Mar 27, 6:06 pm, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
>I don't know how you expect us to help you. Show us some code to
allow us to reproduce your problem.

As a guess, could it be this old ODBC
bug?http://www.aspfaq.com/show.asp?id=2188

Sorry for the lack of detail - I thought it might be a common
weirdness with an upgrade like this. Guess not. The code ran like a
Swiss watch against a 2000 server (and still does). It is very long,
and well, not all that well written. Sadly, I need this to work
against 2005 without re-coding the whole thing. Here's a sample that
contains relevant parts:

connectionstring = "Driver={SQL Native
Client};Server=x.x.x.x;Database=distweb;Uid=xxx;Pw d=xxx;MARS_Connection=
yes;"

OK, so you are using ODBC. Your first step should be to switch to the
native OLE DB provider (from www.connectionstrings.com):
Provider=SQLNCLI;Server=myServerAddress;Database=m yDataBase;Uid=myUserna
me;Pwd=myPassword;

Set oC = Server.CreateObject("ADODB.Connection")
oC.Open connectionstring
Set oRS = Server.CreateObject("ADODB.Recordset")
sqlStr = "SELECT * FROM pagedata WHERE pageid = " & int(pageid) & "
From the link I provided, you should see that it's a bad idea to use
selstar ... especially when you are planning to use only a few of the
columns from the table. do yourself (and whoever has to maintain this
code after you) a favor and replace the * with the list of columns you
are retrieving from the table ... even if you want all the columns that
are currently in the table. Who's to say that somebody isn't going to
come along at some point and add another column to the table?
<snip>
Without details such as column datatypes, I have to stick with my
original guess. Again, see http://www.aspfaq.com/show.asp?id=2188

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 28 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

99
by: Jim Hubbard | last post by:
It seems that Microsoft not only does not need the classic Visual Basic developer army (the largest army of developers the world has ever seen), but now they don't need ANY Windows developer at a...
30
by: Cowboy \(Gregory A. Beamer\) | last post by:
There seems to be a lot of confusion on the versions of Visual Studio 2005. My latest blog entry covers the different versions: Main URL:...
5
by: Mike Owen | last post by:
Hi, I have just used the import Wizard to import a VS 2003 app to VS 2005. I have a lot of work to do to enable it to compile successfully with all the errors and warnings it gave me, but as a...
2
by: xxdanbrowne | last post by:
Hi, Is there any way to transfer Classic ASP session state to ASP.NET Session without resorting to a kludge? i.e. have they included it as an option in session so's you can more easily upgrade a...
5
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The...
2
by: Scott R | last post by:
I have purchased the VS 2005 professional upgrade. I would like to remove VS 2003 prior to installation. If I uninstall VS 2003, how does VS 2005 know I qualify for the upgrade pricing?
2
by: Oonz | last post by:
Hi Friends, Is there any tool or assistant to upgrade SQL 2000 to SQL 2005. Thanks, Arunkumar
4
by: PW | last post by:
Has anyone used the traditional Classic ASP / Access DB / IIS configuration on Vista yet? I haven't, but before I upgrade to Vista I would like to ensure all my websites will work once I do. ...
3
by: Mark D Powell | last post by:
I attempted to upgrade my SQL Server 2000 Enterprise Edition (32 bit) to SQL Severer 2005 EE 32 bit and while the prereqs passed the installer will not let me select the version 8.00.x (2000 SP4)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.