Hi, I hired someone to convert a MS Access DB to MSSql. I cannot reach him and have a problem I need fixed immediately. He took our existing (MSAccess) web page and just changed the connection string and the query for use with the mssql db -- everything else stayed the same, but now the "descr" field will not display, for every product it displays it as if it were empty. I have no idea why.
I know very little about mssql, but in quickly viewing the tables, I noticed the "nulls" box is checked. Unchecking it doesnt seem to effect it.
The file is below. Thanks for any help!!!
Thanks a lot!
---------
<%@LANGUAGE="VBSCRIPT"%>
<!--#include virtual="/Connections/ss.a
sp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
if (Request.QueryString("catI
D") <> "") then Recordset1__MMColParam = Request.QueryString("catID
")
%>
<%
set Recordset1 = Server.CreateObject("ADODB
.Recordset
")
Recordset1.ActiveConnectio
n = MM_ss_STRING
Recordset1.Source = "SELECT itemid,catid,itemname,desc
r,amount,c
onvert(var
char(8000)
,photo) photo,sold,featured FROM items WHERE sold = 0 AND catID = '" + Replace(Recordset1__MMColP
aram, "'", "''") + "' and catID is not null ORDER BY itemname ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Recordset3__MMColParam
Recordset3__MMColParam = "1"
if (Request.QueryString("catI
D") <> "") then Recordset3__MMColParam = Request.QueryString("catID
")
%>
<%
set Recordset3 = Server.CreateObject("ADODB
.Recordset
")
Recordset3.ActiveConnectio
n = MM_ss_STRING
Recordset3.Source = "SELECT * FROM categories WHERE catID = " + Replace(Recordset3__MMColP
aram, "'", "''") + ""
Recordset3.CursorType = 0
Recordset3.CursorLocation = 2
Recordset3.LockType = 3
Recordset3.Open()
Recordset3_numRows = 0
%>
<%
set Recordset5 = Server.CreateObject("ADODB
.Recordset
")
Recordset5.ActiveConnectio
n = MM_ss_STRING
Recordset5.Source = "SELECT itemid,catid,itemname,desc
r,amount,c
onvert(var
char(8000)
,photo) photo,sold,featured FROM items WHERE sold = 0 and Featured = 1"
Recordset5.CursorType = 0
Recordset5.CursorLocation = 2
Recordset5.LockType = 3
Recordset5.Open()
Recordset5_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
' set the record count
Recordset1_total = Recordset1.RecordCount
' set the number of rows displayed on this page
If (Recordset1_numRows < 0) Then
Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
Recordset1_numRows = 1
End If
' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1
' if we have the correct record count, check the other stats
If (Recordset1_total <> -1) Then
If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total
If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total
If (Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (Recordset1_total = -1) Then
' count the total records by iterating through the recordset
Recordset1_total=0
While (Not Recordset1.EOF)
Recordset1_total = Recordset1_total + 1
Recordset1.MoveNext
Wend
' reset the cursor to the beginning
If (Recordset1.CursorType > 0) Then
Recordset1.MoveFirst
Else
Recordset1.Requery
End If
' set the number of rows displayed on this page
If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then
Recordset1_numRows = Recordset1_total
End If
' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1
If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total
If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total
End If
%>
<%
' *** Move To Record and Go To Record: declare variables
Set MM_rs = Recordset1
MM_rsCount = Recordset1_total
MM_size = Recordset1_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
MM_paramIsDefined = (Request.QueryString(MM_pa
ramName) <> "")
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter
if (Not MM_paramIsDefined And MM_rsCount <> 0) then
' use index parameter if defined, otherwise use offset parameter
r = Request.QueryString("index
")
If r = "" Then r = Request.QueryString("offse
t")
If r <> "" Then MM_offset = Int(r)
' if we have a record count, check if we are past the end of the recordset
If (MM_rsCount <> -1) Then
If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last
If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' move the cursor to the selected record
i = 0
While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1))
MM_rs.MoveNext
i = i + 1
Wend
If (MM_rs.EOF) Then MM_offset = i ' set MM_offset to the last possible record
End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range
If (MM_rsCount = -1) Then
' walk to the end of the display range for this page
i = MM_offset
While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size))
MM_rs.MoveNext
i = i + 1
Wend
' if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = i
If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount
End If
' if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) > 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery
End If
' move the cursor to the selected record
i = 0
While (Not MM_rs.EOF And i < MM_offset)
MM_rs.MoveNext
i = i + 1
Wend
End If
%>
<%
' *** Move To Record: update recordset stats
' set the first and last displayed record
Recordset1_first = MM_offset + 1
Recordset1_last = MM_offset + MM_size
If (MM_rsCount <> -1) Then
If (Recordset1_first > MM_rsCount) Then Recordset1_first = MM_rsCount
If (Recordset1_last > MM_rsCount) Then Recordset1_last = MM_rsCount
End If
' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm=
"":MM_keep
Both="":MM
_keepNone=
""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,Nex
tItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.Q
ueryString
(Item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,Nex
tItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.F
orm(Item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links
MM_keepMove = MM_keepBoth
MM_moveParam = "index"
' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 0) Then
MM_moveParam = "offset"
If (MM_keepMove <> "") Then
params = Split(MM_keepMove, "&")
MM_keepMove = ""
For i = 0 To UBound(params)
nextItem = Left(params(i), InStr(params(i),"=") - 1)
If (StrComp(nextItem,MM_moveP
aram,1) <> 0) Then
MM_keepMove = MM_keepMove & "&" & params(i)
End If
Next
If (MM_keepMove <> "") Then
MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
End If
End If
End If
' set the strings for the move to links
If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&"
urlStr = Request.ServerVariables("U
RL") & "?" & MM_keepMove & MM_moveParam & "="
MM_moveFirst = urlStr & "0"
MM_moveLast = urlStr & "-1"
MM_moveNext = urlStr & Cstr(MM_offset + MM_size)
prev = MM_offset - MM_size
If (prev < 0) Then prev = 0
MM_movePrev = urlStr & Cstr(prev)
%>
<html>
<head>
<title>mystore.com - used Samurai parts & vehicles</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name = "Description" content = "suzuki:salvage yards,samurai:salvage,used
parts:junk yard,used Samurai,Samurai parts,Suzuki Samurai parts">
<meta name = "Keywords" content = "used Samurai parts,used Suzuki Samurai parts,Samurais for sale,used Samurais,Samurai salvage,Suzuki Samurai salvage,Iowa Samurais,Marshalltown salvage,Samurai auto salvage,used Samurai parts,used Suzuki parts,auto salvage,wrecked Samurais,used parts,car parts,salvage yards,Samurai salvage,salvage yard,Suzuki,suzuki,suzuki samurai,samurai suzuki,Suzuki,Suzuki Samurai,Samurai Suzuki,four wheel drive,four wheel,Samurai,ASA,asa,Amer
ican Suzuki Association,american suzuki association">
<meta name = "rating" content="General">
<meta name = "robots" content = "follow">
<meta name = "REVISIT-AFTER" content = "5 days">
<meta name = "ABSTRACT" content = "auto salvage;buy,sell:used,dama
ged,wrecke
d,accident
">
<meta name = "CLASS" content = "automotive">
<script src="/vwd_justsopw.js" language = "JavaScript"></script>
<script language="JavaScript">
<!--
function PayPal_AddToCart(ppatc_ema
il,ppatc_i
temname,pp
atc_itemnu
mber,ppatc
_amount,pp
atc_shippi
ng,ppatc_s
hipping2,p
patc_handl
ing,ppatc_
imageurl,p
patc_retur
nurl,ppatc
_cancelurl
) {
var ppatc_string = "
https://www.paypal.com/cart/add=1&business=" + ppatc_email + "&item_name=" + ppatc_itemname + "&item_number=" + ppatc_itemnumber + "&amount=" + ppatc_amount + "&shipping=" + ppatc_shipping + "&shipping2=" + ppatc_shipping2 + "&handling=" + ppatc_handling + "&image_url=" + ppatc_imageurl + "&return=" + ppatc_returnurl + "&cancel_return=" + ppatc_cancelurl;
window.open(ppatc_string,'
ppcart_win
','width=6
00,height=
400,scroll
bars,locat
ion,resiza
ble,status
');
}
//-->
</script>
<link rel="stylesheet" href="/style.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" background="/images/backgr
ound.jpg">
<table width="625" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<!--#include virtual="/top2.asp" -->
</td>
</tr>
</table>
<table width="625" border="0" cellspacing="0" cellpadding="0" align="center" height="100%">
<tr>
<td valign="top" bgcolor="#b0c4de">
<!--#include virtual="/left.asp" -->
</td>
<td width="1" bgcolor="#333333"><img src="/images/clearpixel.gi
f" border="0" width="1" height="1"></td>
<td width="100%" valign="top" bgcolor="#b0c4de">
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="shade">
<tr bgcolor=
<%
RecordCounter = RecordCounter + 1
If RecordCounter Mod 2 = 1 Then
Response.Write "#FFFFCC"
Else
Response.Write "#FFFFB0"
End If
%>> </tr>
</table>
<table width="470" border="0" cellspacing="0" cellpadding="0">
<% if Request.QueryString("catID
") = "" then %>
<tr>
<td>
<table width="96%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr>
<td>
<div align="center">
<!--#include file="homepage.txt" -->
<script language="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!!
http://javascript.internet.com -->
<!-- Begin
var day="";
var month="";
var myweekday="";
var year="";
newdate = new Date();
mydate = new Date();
dston = new Date('April 1, 2007 2:59:59');
dstoff = new Date('october 28, 2007 2:59:59');
var myzone = newdate.getTimezoneOffset(
);
newtime=newdate.getTime();
var zone = 6; // references your time zone
if (newdate > dston && newdate < dstoff ) {
zonea = zone - 1 ;
dst = " CDT";
}
else {
zonea = zone ; dst = " CST";
}
var newzone = (zonea*60*60*1000);
newtimea = newtime+(myzone*60*1000)-n
ewzone;
mydate.setTime(newtimea);
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
myyear= mydate.getYear();
year = myyear;
if (year < 2000) // Y2K Fix, Isaac Powell
year = year + 1900; //
http://onyx.idbsu.edu/~ipowellmyhours = mydate.getHours();
if (myhours >= 12) {
myhours = (myhours == 12) ? 12 : myhours - 12; mm = " PM";
}
else {
myhours = (myhours == 0) ? 12 : myhours; mm = " AM";
}
myminutes = mydate.getMinutes();
if (myminutes < 10){
mytime = ":0" + myminutes;
}
else {
mytime = ":" + myminutes;
};
arday = new Array("Sun","Mon","Tues","
Wed","Thur
s","Fri","
Sat")
armonth = new Array("Jan ","Feb ","March ","April ","May ","June ","July ","Aug ","Sept ", "Oct ","Nov ","Dec ")
ardate = new Array("0th","1st","2nd","3
rd","4th",
"5th","6th
","7th","8
th","9th",
"10th","11
th","12th"
,"13th","1
4th","15th
","16th","
17th","18t
h","19th",
"20th","21
st","22nd"
,"23rd","2
4th","25th
","26th","
27th","28t
h","29th",
"30th","31
st");
// rename locale as needed.
var time = ("In Marshalltown, Iowa it's " + myhours + mytime+ mm + "" +" - " + arday[myday] +", " + armonth[mymonth] +" "+ardate[myweekday] + ", " + year + ". " );
document.write('<font size="1" face="Verdana,Arial">' + time);
//-->
</script>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div align="center"><br>
<img src="/images/didyouknow_de
cal.gif" width="460" height="172" border="0" usemap="#Map"></div>
</td>
</tr>
<tr>
<td height="10" valign="top"> </td>
</tr>
<tr>
<td height="11" valign="top" background="/images/specia
lbuy.gif">
<table width="477" height="150" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td valign="top">
<table width="470" border="0" cellspacing="2" cellpadding="2" align="center">
<tr>
<td colspan="4" class="featurehead"><%=(Re
cordset5.F
ields.Item
("itemname
").Value)%
></td>
</tr>
<tr>
<td valign="top" rowspan="2">
<div align="left" class="bodytext"><%=(Recor
dset5.Fiel
ds.Item("p
hoto").Val
ue)%></div
>
</td>
<td class="bodytext" valign="top" colspan="3"><%=(Recordset5
.Fields.It
em("descr"
).Value)%>
<br>
<span class="smallboldred">
<% if NOT Request.QueryString("catID
") = "1" and NOT Request.QueryString("catID
") = "" then %>
PRICE INCLUDES SHIPPING IN THE LOWER 48
<% End If ' end Recordset1.EOF And Recordset1.BOF %>
</span></td>
</tr>
<tr>
<td class="bodytext" valign="middle">
<div align="right"><span class="small">ID#:<%=(Reco
rdset5.Fie
lds.Item("
itemID").V
alue)%><br
>
</span><%= FormatCurrency((Recordset5
.Fields.It
em("amount
").Value),
0, -2, -2, -2) %></div>
</td>
<td class="bodytext" valign="middle" width="18%">
<div align="right"><a href="/moreinfo.asp?itemID
=<%=(Recor
dset5.Fiel
ds.Item("i
temID").Va
lue)%>"><i
mg src="/images/info_request.
gif" width="83" height="32" border="0"></a></div>
</td>
<td class="bodytext" valign="middle" width="15%">
<div align="right"><a href="javascript:;" onClick="PayPal_AddToCart(
'info@myst
ore.com','
<%=Records
et5.Fields
.Item("ite
mname").Va
lue%>','<%
=Recordset
5.Fields.I
tem("itemI
D").Value%
>','<%=Rec
ordset5.Fi
elds.Item(
"amount").
Value%>','
<%=""%>','
<%=""%>','
<%=""%>','
https://samuraisalvage.secureserverdot.com/logo_paypal.GIF','http://www.mystore.com/thanks.htm','http://www.mystore.com./')"><img src="/images/paypal.gif" width="62" height="31" border="0" vspace="0" hspace="5"></a></div>
</td>
</tr>
</table>
<b></b> </td>
</tr>
</table>
</td>
</tr>
<% End If %>
</table>
<div>
<div align="left">
<p><span class="category"> <%=
(Recordset
3.Fields.I
tem("catNa
me").Value
)%></span>
&nbs
p;<span class="small">Click any thumbnail
to view a larger version</span></p>
</div>
</div>
</div>
<table width="470" border="0" cellspacing="2" cellpadding="2" align="center">
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td colspan="4" class="featurehead"><%=(Re
cordset1.F
ields.Item
("itemname
").Value)%
></td>
</tr>
<tr>
<td valign="top" rowspan="2">
<div align="left" class="bodytext"><%=(Recor
dset1.Fiel
ds.Item("p
hoto").Val
ue)%></div
>
</td>
<td class="bodytext" valign="top" colspan="3"><%=(Recordset1
.Fields.It
em("descr"
).Value)%>
<br>
<span class="smallboldred">
<% if NOT Request.QueryString("catID
") = "1" and NOT Request.QueryString("catID
") = "" then %>
PRICE INCLUDES SHIPPING IN THE LOWER 48
<% End If ' end Recordset1.EOF And Recordset1.BOF %>
</span></td>
</tr>
<tr>
<td class="bodytext" valign="middle">
<div align="right"><span class="small">ID#:<%=(Reco
rdset1.Fie
lds.Item("
itemID").V
alue)%><br
>
</span><%= FormatCurrency((Recordset1
.Fields.It
em("amount
").Value),
0, -2, -2, -2) %></div>
</td>
<td class="bodytext" valign="middle" width="18%">
<div align="right"><a href="/moreinfo.asp?itemID
=<%=(Recor
dset1.Fiel
ds.Item("i
temID").Va
lue)%>"><i
mg src="/images/info_request.
gif" width="83" height="32" border="0"></a></div>
</td>
<td class="bodytext" valign="middle" width="15%">
<div align="right"><a href="javascript:;" onClick="PayPal_AddToCart(
'info@myst
ore.com','
<%=Records
et1.Fields
.Item("ite
mname").Va
lue%>','<%
=Recordset
1.Fields.I
tem("itemI
D").Value%
>','<%=Rec
ordset1.Fi
elds.Item(
"amount").
Value%>','
<%=""%>','
<%=""%>','
<%=""%>','
https://www.mystore.com/logo_paypal.gif','http://www.mystore.com/thanks.htm','http://www.mystore.com./')"><img
src="/images/paypal.gif" width="62" height="31" border="0"></a></div>
</td>
</tr>
<%
Repeat1__index=Repeat1__in
dex+1
Repeat1__numRows=Repeat1__
numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
<div align="center" class="small">
<hr width="85%">
<p><span class="smallyellow"> Inventory <%=(Recordset1_first)%> to <%=(Recordset1_last)%> of <%=(Recordset1_total)%></s
pan></p>
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_moveFirst%>" class="smallnext">First</a
>
<% End If ' end MM_offset <> 0 %>
</td>
<td width="31%" align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_movePrev%>" class="smallnext">Previous
</a>
<% End If ' end MM_offset <> 0 %>
</td>
<td width="23%" align="center">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveNext%>" class="smallnext">Next</a>
<% End If ' end Not MM_atTotal %>
</td>
<td width="23%" align="center" class="smallnext">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveLast%>">La
st</a>
<% End If ' end Not MM_atTotal %>
</td>
</tr>
</table>
<span class="visitorsonline">The
re are currently <%=Application("visitors_o
nline")%> visitor(s) online </span></div>
</td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="317,64,372,78" href="mailto:info@mystore.
com" alt="send email!">
<area shape="rect" coords="4,87,460,168" href="
http://www.mystore.com/itemdetail.asp?txtitemname=decal&catid=&itemID=576" alt="decal info">
</map>
%>
<script src="
http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2251798-1";
urchinTracker();
</script>
</body>
</html>
<%
Recordset1.Close()
%>
<%
Recordset3.Close()
%>
<%
Recordset5.Close()
%>