Can you - and how - check a database connection online? (Full Version)

All Forums >> [Web Development] >> ASP, PHP, and Database



Message


pmagas -> Can you - and how - check a database connection online? (1/27/2004 17:13:20)

I have a site with a search (beneath a Spooky login) using FP2000, Access2000 & built using the DRW. It was working great a week ago. I haven't changed the search or result pages at all, but I update the database daily. Apparently something went wrong in my database updates because now I get the following message:
quote:

Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
Number: -2147217904 (0x80040E10)
Source: Microsoft OLE DB Provider for ODBC Drivers

Is there a way to check my database connection live to see if it's the connection? If it's not the connection, can you offer any suggestions? The only thing I can think of is that I inadvertently changed one of the database field properties. (when I update the database, I simply delete the old data and import the new data using the same structure.)

should you wish to look at it, login here using outfront as both the username and password. None of the searches work. [:@] They all pull from the same database.

Thanks for any help/suggestions you can offer!




Mike54 -> RE: Can you - and how - check a database connection online? (1/27/2004 17:28:52)

Hi Penny,

Open your site live and go to tools > site settings > database. Highlight the dB and click on verify. That will check the connection. It looks like the connections ok but I'm sorry I can't offer a cause.[&o] Have you checked the error in the KB at www.support.microsoft.com? Or try Google as it sometimes finds things at MS that MS can't find.[8D]




pmagas -> RE: Can you - and how - check a database connection online? (1/27/2004 18:04:45)

Thanks, Mike - sometimes those simple things elude me, especially when I'm frustrated at something not working. The connection's fine - time to get into the hairy detail and figure out what I did wrong.

I visited your Photogallery - it's GREAT!! Thanks for sharing those - in 5 minutes time, I relaxed and have a little better perspective on things. [8D]

Thank you for your assistance! Have a great day!




BeTheBall -> RE: Can you - and how - check a database connection online? (1/27/2004 18:11:55)

Post your SQL. I know you said you didn't change anything, but that error means your SQL cannot find a value for one of the parameters in the SQL statement.




pmagas -> RE: Can you - and how - check a database connection online? (1/27/2004 18:30:50)

I haven't put it on a Spooky diet yet - wanted to make sure it was stable first. <arghh..>
Is this what you're looking for? Too much or too little?
quote:

<!--webbot bot="DatabaseRegionStart"
startspan
s-columnnames="ID,ML_Number,Listing Price,Address,Address - City,Address - Zip Code,Area Number,Area Desc,Bedrooms,Bathrooms,Square Footage,Lot Size - Acres,Marketing Remarks,Style Desc,Property Type Desc,Address - Street Name,Address - Street Number,Age,directory,urlpath"
s-columntypes="3,202,6,202,202,202,202,202,3,3,3,3,203,202,202,202,202,3,202,202"
s-dataconnection="homes" b-tableformat="FALSE"
b-menuformat="FALSE" s-menuchoice="ML_Number" s-menuvalue="ML_Number"
b-tableborder="TRUE" b-tableexpand="TRUE"
b-tableheader="TRUE" b-listlabels="TRUE"
b-listseparator="FALSE" i-ListFormat="1"
b-makeform="FALSE" s-recordsource
s-displaycolumns="ML_Number,Listing Price,Address,Area Desc,Bedrooms,Bathrooms,Square Footage,Lot Size - Acres,Marketing Remarks,Style Desc,urlpath"
s-criteria s-order
s-sql="SELECT * FROM homes WHERE ("Listing Price" >= ::From:: AND "Listing Price" <= ::To:: AND Bathrooms >= ::Bathrooms:: AND Bedrooms >= ::Bedrooms:: AND "Area Desc" = '::Area::' AND "Property Type Desc" = 'Condo/Cluster Coop') ORDER BY "Listing Price" DESC"
b-procedure="FALSE" clientside SuggestedExt="asp"
s-DefaultFields="From=75000&To=5000000&Bathrooms=1&Bedrooms=2&Area=1"
s-NoRecordsFound="Sorry - no condos or lofts match your criteria today. Please try another search or request a Custom Home Search."
i-MaxRecords="256" i-GroupSize="5" BOTID="0"
u-dblib="_fpclass/fpdblib.inc"
u-dbrgn1="_fpclass/fpdbrgn1.inc"
u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY"
local_preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00" align="left"><font color="#000000">Database Results regions will not preview unless this page is fetched from a Web server using a web browser. The section of the page from here to the end of the Database Results region will repeat once for each record returned by the query.</font></td></tr></table>"
preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00" align="left"><font color="#000000">This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.</font></td></tr></table>" b-WasTableFormat="FALSE" --><!--#include file="_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM homes WHERE (""Listing Price"" >= ::From:: AND ""Listing Price"" <= ::To:: AND Bathrooms >= ::Bathrooms:: AND Bedrooms >= ::Bedrooms:: AND ""Area Desc"" = '::Area::' AND ""Property Type Desc"" = 'Condo/Cluster Coop') ORDER BY ""Listing Price"" DESC"
fp_sDefault="From=75000&To=5000000&Bathrooms=1&Bedrooms=2&Area=1"
fp_sNoRecords="Sorry - no condos or lofts match your criteria today. Please try another search or request a Custom Home Search."
fp_sDataConn="homes"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="ML_Number"
fp_sMenuValue="ML_Number"
fp_iDisplayCols=11
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>

<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" i-CheckSum="3358" endspan -->


I generally focus on the red, since once we do the diet, most of the rest 'goes away.' I thought my problem might be in the 'Area' -- It's a text field and I have it equalling the description. I tried changing it to LIKE, but that didn't work either.

The choices pull from another form -
quote:

<form BOTID="0" METHOD="POST" ACTION="condosfound.asp" onsubmit="return FrontPage_Form2_Validator(this)" name="FrontPage_Form2">
<table BORDER="0">
<tr>
<td colspan="2"><font color="#333300"><b>Create
Your Search:</b></font></td>
</tr>
<tr>
<td><font face="Verdana" size="3">From</font></td>
<td><font face="Verdana" size="3"><!--webbot
bot="Validation" S-Data-Type="Number"
S-Number-Separators=",." --><input NAME="From" VALUE="75000" size="20"></font></td>
</tr>
<tr>
<td><font face="Verdana" size="3">To</font></td>
<td><font face="Verdana" size="3"><!--webbot
bot="Validation" S-Data-Type="Number"
S-Number-Separators=",." --><input NAME="To" VALUE="5000000" size="20"></font></td>
</tr>
<tr>
<td><font face="Verdana" size="3">Bathrooms</font></td>
<td><font face="Verdana" size="3"><!--webbot
bot="Validation" B-Value-Required="TRUE" --><select size="1" NAME="Bathrooms" VALUE="<%=Request("Bathrooms")%>">
<option value="1" selected>1 or more</option>
<option value="1.5">1.5 or more</option>
<option value="2">2 or more</option>
<option value="2.5">2.5 or more</option>
<option value="3">3 or more</option>
</select></font></td>
</tr>
<tr>
<td><font face="Verdana" size="3">Bedrooms</font></td>
<td><font face="Verdana" size="3"><!--webbot
bot="Validation" B-Value-Required="TRUE" --><select size="1" NAME="Bedrooms" VALUE="<%=Request("Bedrooms")%>">
<option value="1">1 or more</option>
<option value="2" selected>2 or more</option>
<option value="3">3 or more</option>
<option value="4">4 or more</option>
<option value="5">5 or more</option>
</select></font></td>
</tr>
<tr>
<td><font face="Verdana" size="3">Area</font></td>
<td><font face="Verdana" size="3"><!--webbot
bot="Validation" B-Value-Required="TRUE" --><select size="1" NAME="Area" VALUE="<%=Request("Area")%>">
<option value="Affton">Affton</option>
<option value="Bayless">Bayless</option>
<option value="Brentwood">Brentwood</option>
<option value="Clayton">Clayton</option>
<option value="Crystal City">Crystal City</option>
<option value="Desoto">Desoto</option>
<option value="Eureka">Eureka</option>
<option value="Ferguson-Florissant">Ferguson-Florissant</option>
<option value="Festus">Festus</option>
<option value="Fort Zumwalt North">Fort Zumwalt
North</option>
<option value="Fort Zumwalt South">Fort Zumwalt
South</option>
<option value="Fort Zumwalt West">Fort Zumwalt
West</option>
<option value="Fox C-6">Fox C-6</option>
<option value="Francis Howell">Francis Howell</option>
<option value="Francis Howell Cntrl">Francis
Howell Central</option>
<option value="Francis Howell North">Francis
Howell North</option>
<option value="Grandview">Grandview</option>
<option value="Hancock Place">Hancock Place</option>
<option value="Hazelwood Central">Hazelwood
Central</option>
<option value="Hazelwood East">Hazelwood East</option>
<option value="Hazelwood West">Hazelwood West</option>
<option value="Herculaneum">Herculaneum</option>
<option value="Hillsboro">Hillsboro</option>
<option value="Jennings">Jennings</option>
<option value="Kirkwood">Kirkwood</option>
<option value="Ladue">Ladue</option>
<option value="Lafayette">Lafayette</option>
<option value="Lindbergh">Lindbergh</option>
<option value="Maplewood-Rchmnd Hts">Maplewood-Rchmnd
Hts</option>
<option value="Marquette">Marquette</option>
<option value="Mehlville">Mehlville</option>
<option value="Normandy">Normandy</option>
<option value="Northwest">Northwest</option>
<option value="Oakville">Oakville</option>
<option value="Orchard Farm">Orchard Farm</option>
<option value="Pacific/Meramec R-3">Pacific/Meramec
R-3</option>
<option value="Parkway Central">Parkway Central</option>
<option value="Parkway North">Parkway North</option>
<option value="Parkway South">Parkway South</option>
<option value="Parkway West">Parkway West</option>
<option value="Pattonville">Pattonville</option>
<option value="Ritenour">Ritenour</option>
<option value="Riverview Gardens">Riverview
Gardens</option>
<option value="Rockwood Summit">Rockwood Summit</option>
<option value="Seckman">Seckman</option>
<option value="St. Charles">St. Charles</option>
<option value="St. Charles West">St. Charles West</option>
<option value="St. Genevieve County">St. Genevieve
County</option>
<option value="St. Louis E of Grand">St. Louis E
of Grand</option>
<option value="St. Louis, North">St. Louis, North</option>
<option value="St. Louis, SW">St. Louis, SW</option>
<option value="St. Louis, W-Central">St. Louis,
W-Central</option>
<option value="University City">University City</option>
<option value="Valley Park">Valley Park</option>
<option value="Washington (St. Charles)">Washington
(St. Charles)</option>
<option value="Webster Groves">Webster Groves</option>
<option value="Wellston">Wellston</option>
<option value="Wentzville">Wentzville</option>
<option value="Windsor">Windsor</option>
</select></font></td>
</tr>
</table>
<br>
<input TYPE="Submit"><input TYPE="Reset"><!--webbot
bot="SaveAsASP" CLIENTSIDE SuggestedExt="asp"
PREVIEW=" " -->
<p> </p>
<input type="hidden" name="Property_Type" value="RESI">
</form>


Sorry about the length here. Thanks for your help!!




BeTheBall -> RE: Can you - and how - check a database connection online? (1/27/2004 18:42:32)

I had this problem of FP putting in the two sets of double quotes, but can't remember if it threw the missing parameter error or not. I would begin by dieting the page and changing the SQL to:

fp_sQry="SELECT * FROM homes WHERE ([Listing Price] >= ::From:: AND [Listing Price] <= ::To:: AND Bathrooms >= ::Bathrooms:: AND Bedrooms >= ::Bedrooms:: AND [Area Desc] = '::Area::' AND [Property Type Desc] = 'Condo/Cluster Coop') ORDER BY [Listing Price] DESC"

Also, verify that Listing Price, Bathrooms, Bedrooms, Area Desc and Propery Type Desc match exactly what the field names are called in your db. For example, I noticed your form has a hidden field titled Property_Type. Make sure your db field isn't named similarly.




hzarabet -> RE: Can you - and how - check a database connection online? (1/27/2004 19:31:34)

Are any of these fields NULL in the table? It may be trying to read a NULL value.




pmagas -> RE: Can you - and how - check a database connection online? (1/27/2004 20:12:49)

No, I don't have any NULL values.

Here's what's coming from the form on the search page:
quote:

<form BOTID="0" METHOD="POST" ACTION="condosfound.asp" onsubmit="return FrontPage_Form2_Validator(this)" name="FrontPage_Form2">
<table BORDER="0">
<tr>
<td colspan="2"><font color="#333300"><b>Create
Your Search:</b></font></td>
</tr>
<tr>
<td><font face="Verdana" size="3">From</font></td>
<td><font face="Verdana" size="3"><!--webbot
bot="Validation" S-Data-Type="Number"
S-Number-Separators=",." --><input NAME="From" VALUE="75000" size="20"></font></td>
</tr>
<tr>
<td><font face="Verdana" size="3">To</font></td>
<td><font face="Verdana" size="3"><!--webbot
bot="Validation" S-Data-Type="Number"
S-Number-Separators=",." --><input NAME="To" VALUE="5000000" size="20"></font></td>
</tr>
<tr>
<td><font face="Verdana" size="3">Bathrooms</font></td>
<td><font face="Verdana" size="3"><!--webbot
bot="Validation" B-Value-Required="TRUE" --><select size="1" NAME="Bathrooms" VALUE="<%=Request("Bathrooms")%>">
<option value="1" selected>1 or more</option>
<option value="1.5">1.5 or more</option>
<option value="2">2 or more</option>
<option value="2.5">2.5 or more</option>
<option value="3">3 or more</option>
</select></font></td>
</tr>
<tr>
<td><font face="Verdana" size="3">Bedrooms</font></td>
<td><font face="Verdana" size="3"><!--webbot
bot="Validation" B-Value-Required="TRUE" --><select size="1" NAME="Bedrooms" VALUE="<%=Request("Bedrooms")%>">
<option value="1">1 or more</option>
<option value="2" selected>2 or more</option>
<option value="3">3 or more</option>
<option value="4">4 or more</option>
<option value="5">5 or more</option>
</select></font></td>
</tr>
<tr>
<td><font face="Verdana" size="3">Area</font></td>
<td><font face="Verdana" size="3"><!--webbot
bot="Validation" B-Value-Required="TRUE" --><select size="1" NAME="Area" VALUE="<%=Request("Area")%>">
<option selected value="%">All Areas</option>
<option value="Affton">Affton</option>
<option value="Bayless">Bayless</option>
<option value="Brentwood">Brentwood</option>
... lots of values deleted for the sake of brevity ....
<option value="Wentzville">Wentzville</option>
<option value="Windsor">Windsor</option>
</select>


Side thought ***Is there significance that the Bedrooms, Bathrooms & Area have the VALUE statements (see red above) or is it simply because those are pull-downs whereas the others are just text boxes? ****

The fields (and types) in my database and the query (it pulls from the query rather than the table, but all the field names are the same - I double-checked) are:
Area Desc - text (yes, there's a space in there, but to change it makes my daily import difficult, so I'd rather keep the space if I can)
Bedrooms - number
Bathrooms - number
Property Type Desc - text
Listing Price - currency

I did the Spooky diet. Here's my most recent results page code:
quote:

<!--#include file="_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM homes WHERE ([Listing Price] >= ::From:: AND [Listing Price] <= ::To:: AND Bathrooms >= ::Bathrooms:: AND Bedrooms >= ::Bedrooms:: AND [Area Desc] LIKE '%::Area::%' AND [Property Type Desc] = 'Condo/Cluster Coop') ORDER BY [Listing Price] DESC"
fp_sDefault="From=75000&To=5000000&Bathrooms=1&Bedrooms=2&Area=%"
fp_sNoRecords="Sorry - no condos or lofts match your criteria today. Please try another search or request a Custom Home Search."
fp_sDataConn="homes"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="ML_Number"
fp_sMenuValue="ML_Number"
fp_iDisplayCols=11
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<p><b>Listing Number:</b> <%=FP_FieldVal(fp_rs,"ML_Number")%>
<br>
<b>Listing Price:</b> <%=FormatCurrency(FP_FieldVal(fp_rs,"Listing Price"),0)%>
<br>
<b>Address:</b> <%=FP_FieldVal(fp_rs,"Address")%>
<br>
<b>School District/Area:</b> <%=FP_FieldVal(fp_rs,"Area Desc")%>
<br>
<b>Bedrooms:</b> <%=FP_FieldVal(fp_rs,"Bedrooms")%>
<br>
<b>Bathrooms:</b> <%=FP_FieldVal(fp_rs,"Bathrooms")%>
<br>
<b>Square Footage:</b> <%=FP_FieldVal(fp_rs,"Square Footage")%>
<br>
<b>Lot Size - Acres:</b> <%=FP_FieldVal(fp_rs,"Lot Size - Acres")%>
<br>
<b>Description:</b> <%=FP_FieldVal(fp_rs,"Marketing Remarks")%>
<br>
<b>Style:</b> <%=FP_FieldVal(fp_rs,"Style Desc")%>
<br>
<a href="images/p_nophoto.jpg">
<img border="0" src="<%=FP_FieldLink(fp_rs,"urlpath")%>">
</a>
<p style="margin: 0"><font face="Verdana" size="2"><a href="mailto:homes@marksellsstlouis.net?subject=Listing Number <%=FP_FieldLink(fp_rs,"ML_Number")%>"><b>Request
More Information</b></a></font></p>
<!--#include file="_fpclass/fpdbrgn2.inc"-->


I changed the comparison for Area to LIKE rather than = and added a choice of All Areas - value %. I have another set of searches that work off different databases (they're still working - knock on wood) that use the LIKE comparison for the Area.

It continues to give me the same error message... clearly I haven't spotted the problem. [:o] It's most frustrating because this is one of the most popular parts of my site and it's down now. [:-]

Thank you all for all your help and your continued support!!!




BeTheBall -> RE: Can you - and how - check a database connection online? (1/27/2004 22:05:28)

I can't seem to see it either. You may want to eliminate one segment of your WHERE clause at a time to see which is causing the problem. For example, try without the Bathroom portion like this:

fp_sQry="SELECT * FROM homes WHERE ([Listing Price] >= ::From:: AND [Listing Price] <= ::To:: AND Bedrooms >= ::Bedrooms:: AND [Area Desc] LIKE '%::Area::%' AND [Property Type Desc] = 'Condo/Cluster Coop') ORDER BY [Listing Price] DESC"

If the error persists, then try taking out a different portion, such as Bedrooms and continue until you have tried them all. Also, try writing out your SQL to see if that reveals anything about the error. You do this by changing the red code to something like this:

<%
fp_sQry="SELECT * FROM homes WHERE ([Listing Price] >= ::From:: AND [Listing Price] <= ::To:: AND Bathrooms >= ::Bathrooms:: AND Bedrooms >= ::Bedrooms:: AND [Area Desc] LIKE '%::Area::%' AND [Property Type Desc] = 'Condo/Cluster Coop') ORDER BY [Listing Price] DESC"
fp_sDefault="From=75000&To=5000000&Bathrooms=1&Bedrooms=2&Area=%"
fp_sNoRecords="Sorry - no condos or lofts match your criteria today. Please try another search or request a Custom Home Search."
fp_sDataConn="homes"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="ML_Number"
fp_sMenuValue="ML_Number"
fp_iDisplayCols=11
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
Response.write fp_sQry
Response.End
%>




Larry M. -> RE: Can you - and how - check a database connection online? (1/28/2004 10:14:40)

<<I would begin by dieting the page>>

Duane,

Trying to come onboard re: FP DRW. Would you explain above and point me in the right direction to buy? Gather this is something our esteemed Spooky offers or otherwise is knowledgeable about.

Thanks!




Mike54 -> RE: Can you - and how - check a database connection online? (1/28/2004 10:29:18)

Larry

Here's a link to the Spooky tutorial on dieting




rdouglass -> RE: Can you - and how - check a database connection online? (1/28/2004 11:04:14)

quote:

Listing Price - currency


Could this be an issue? I never have any luck using currency field types in Access - I always make 'em just a number field and worry 'bout the formatting stuff using the FormatCurrency VBScript function. That way if all my numbers are just that - numbers - I don't have to worry 'bout that stuff.

That particular error I see when the field types are mismatched or you have blank form fields. It doesn't really look like your form fields are blank, but you may want to Response.write them all out somewhere before the DWR just to see if they're valid.

</$.02>




Spooky -> RE: Can you - and how - check a database connection online? (1/28/2004 14:04:15)

<% 
fp_sQry="SELECT * FROM homes WHERE ([Listing Price] >= ::From:: AND [Listing Price] <= ::To:: AND Bathrooms >= ::Bathrooms:: AND Bedrooms >= ::Bedrooms:: AND [Area Desc] LIKE '%::Area::%' AND [Property Type Desc] = 'Condo/Cluster Coop') ORDER BY [Listing Price] DESC" 

Response.write fp_sQry
Response.end


Then tell us what the web page says [&:]




pmagas -> RE: Can you - and how - check a database connection online? (1/28/2004 20:48:59)

[sm=ask.gif]

ummmm... clearly I did something wrong because the page cannot be displayed. I put what you suggested, Spooky, on the search results page. (I have the form on a separate page.) And I put it in place of the SQL that was there before.

Can you tell me where I went wrong. I feel rather foolish - think this might be one of those times I 'know enough to be dangerous.'

Thank you for all the hand-holding. Please pardon me for taking so long to respond - had to do some PC troubleshooting offsite today - that MyDoom worm threw everyone in a 'tizzy' and seriously bogged down some machines.




Spooky -> RE: Can you - and how - check a database connection online? (1/28/2004 20:53:22)

IE > tools > options > advanced > DONT show friendly http errors




pmagas -> RE: Can you - and how - check a database connection online? (1/28/2004 21:06:51)

Cool! I didn't know I had that checked! Thanks Spooky!

Here's what I get, but I must admit, I don't know how to fix it....

quote:

Microsoft VBScript compilation error '800a0400'

Expected statement

/condosfound.asp, line 124

<p><b>Listing Number:</b> <%=FP_FieldVal(fp_rs,"ML_Number")
^




Spooky -> RE: Can you - and how - check a database connection online? (1/28/2004 21:19:10)

What did you change?

Did you just insert the code :

Response.write fp_sQry
Response.end


Inside the current asp delimiters in the place I showed above?




pmagas -> RE: Can you - and how - check a database connection online? (1/28/2004 21:27:48)

I replaced the entire block here:
quote:

<%
fp_sQry="SELECT * FROM homes WHERE ([Listing Price] >= ::From:: AND [Listing Price] <= ::To:: AND Bathrooms >= ::Bathrooms:: AND Bedrooms >= ::Bedrooms:: AND [Area Desc] LIKE '%::Area::%' AND [Property Type Desc] = 'Condo/Cluster Coop') ORDER BY [Listing Price] DESC"
fp_sDefault="From=75000&To=5000000&Bathrooms=1&Bedrooms=2&Area=%"
fp_sNoRecords="Sorry - no condos or lofts match your criteria today. Please try another search or request a Custom Home Search."
fp_sDataConn="homes"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="ML_Number"
fp_sMenuValue="ML_Number"
fp_iDisplayCols=11
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>


with your:
quote:

<% fp_sQry="SELECT * FROM homes WHERE ([Listing Price] >= ::From:: AND [Listing Price] <= ::To:: AND Bathrooms >= ::Bathrooms:: AND Bedrooms >= ::Bedrooms:: AND [Area Desc] LIKE '%::Area::%' AND [Property Type Desc] = 'Condo/Cluster Coop') ORDER BY [Listing Price] DESC"
Response.write fp_sQry
Response.end


Should I have incorporated what you gave me, instead? should it be:
quote:

<% fp_sQry="SELECT * FROM homes WHERE ([Listing Price] >= ::From:: AND [Listing Price] <= ::To:: AND Bathrooms >= ::Bathrooms:: AND Bedrooms >= ::Bedrooms:: AND [Area Desc] LIKE '%::Area::%' AND [Property Type Desc] = 'Condo/Cluster Coop') ORDER BY [Listing Price] DESC" fp_sDefault="From=75000&To=5000000&Bathrooms=1&Bedrooms=2&Area=%"
fp_sNoRecords="Sorry - no condos or lofts match your criteria today. Please try another search or request a Custom Home Search."
fp_sDataConn="homes"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="ML_Number"
fp_sMenuValue="ML_Number"
fp_iDisplayCols=11
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
Response.write fp_sQry
Response.end
%>


PS - looks like I'm really living up to that 'humble' in my signature. Wonder if I'll ever make it to 'simple webmaster' - hmmm..... maybe already there when you think about the meaning of 'simple' [sm=icon_redface.gif]

Thank you for your patience and help!




Spooky -> RE: Can you - and how - check a database connection online? (1/28/2004 21:34:18)

That should do it - what does the SQL string read now? (When you browse that page)




pmagas -> RE: Can you - and how - check a database connection online? (1/28/2004 21:43:37)

Here's what it reads now:
quote:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/condosfound.asp, line 120

fp_sQry="SELECT * FROM homes WHERE ([Listing Price] >= ::From:: AND [Listing Price] <= ::To:: AND Bathrooms >= ::Bathrooms:: AND Bedrooms >= ::Bedrooms:: AND [Area Desc] LIKE '%::Area::%' AND [Property Type Desc] = 'Condo/Cluster Coop') ORDER BY [Listing Price] DESC" fp_sDefault="From=75000&To=5000000&Bathrooms=1&Bedrooms=2&Area=%"
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^


I don't see the statement that isn't ended..... or do I just misunderstand?




Spooky -> RE: Can you - and how - check a database connection online? (1/28/2004 22:27:21)

I think its actually something to do with the database?
You are querying "homes" which is a stored procedure (query)

If I query cityres, I get no problems.
What does the "homes" query do differently? does it require parameters?

I was going to have a look, but its quite large [;)]




pmagas -> RE: Can you - and how - check a database connection online? (1/28/2004 22:36:19)

hmmmm... the homes query adds a couple of fields that I couldn't figure out how to do in the database itself.

The database that I download from changed their fields and no longer gives me a link to pictures. But I can figure out where the link is. For a listing with ML#400376, the picture is at http://maris.rapmls.com/listingpics/tmbphoto/76/400376.jpg The directory 76 changes - it's always the last 2 digits of the ML number.

So I have one field in the query that figures out the directory
quote:

directory: Right([ML_Number],2)
and the other figures out the url for the picture.
quote:

urlpath: "http://maris.rapmls.com/listingpics/bigphoto/" & [directory] & "/" & [ML_Number] & ".jpg"


I couldn't figure out how to have the table calculate the contents of a field, so I have the query doing that....

What strikes me as odd is that it worked until a couple of days ago (I made these major changes about 10 days ago.) No matter, though....




Spooky -> RE: Can you - and how - check a database connection online? (1/28/2004 22:37:26)

Have you made any adjustments to the database?
It seems it came about as a result of the database upload, not any other changes.

Do you have a previous version you can upload / swap for testing?




Spooky -> RE: Can you - and how - check a database connection online? (1/28/2004 22:42:40)

To get the image in asp, youd do :

<img src="http://maris.rapmls.com/listingpics/bigphoto/<%=right(FP_Field(fp_rs,"ML_Number"),2)%>/<%=FP_Field(fp_rs,"ML_Number")%>.jpg">




pmagas -> RE: Can you - and how - check a database connection online? (1/28/2004 22:49:20)

I fear not, but I'll look around. Generally speaking, I keep the original database and just delete the old records and insert the new ones.

There is one strange thing that's been happening, though and its occurence may have caused me to overlook some unintentional change. I mentioned the fields changed in the original database I export from. When they did, they changed the name of the Area Number field for the Condos to Area; but it's still Area Number for Residential & New Constr. (For each type, I have to do a separate download but until this last change, they all had common field names.) Now, when I import the data, I have to change the field name in the database before I do the import. If I got into one of the other fields & changed it - even a little - I might not have noticed and then saved the changes to the structure.

I think I'll have to break out the condos to a separate database to avoid this happening again.

I'll hunt around for an old version....




pmagas -> RE: Can you - and how - check a database connection online? (1/28/2004 23:01:14)

Spooky - you are just too good. I'm embarrassed it didn't occur to me to do it that way - duh!! I can't tell you the hours I spent messing around with Access to get it in the table or the query. Thank you!! I'll change my SQL to query cityres and put in the statement above..... will let you know when I have it fixed.

Can you recommend a good ASP book - seems I'm in serious need of learning some basics. The book I bought a while back turned out to be insubstantial. And clearly I'm not doing a good job of learning along the way.

I'm forever indebted to you!




pmagas -> RE: Can you - and how - check a database connection online? (1/28/2004 23:11:35)

Spooky - It worked like a charm!! I can't thank you enough...

Warm regards from a snowy state...




Spooky -> RE: Can you - and how - check a database connection online? (1/28/2004 23:39:45)

Glad to help [;)]
Im not a terrible fan of asp books these days. Its relevant, but the direction is still .net
I feel asp will be around for a while, but not sure that books are value for money at this time when many web sites give you an awful lot of information too.




pmagas -> RE: Can you - and how - check a database connection online? (1/28/2004 23:48:03)

Heaven knows I've gotten a phenomenal amount of value from this site and forum. [:)] I certainly trust your judgment.... I'll poke around for some sites with basic asp 'stuff' and who knows - maybe the local library will have some ASP books. And I'll start looking into the asp.net since that's where we're headed. Maybe I'll start with the basics this time. [&:]




Spooky -> RE: Can you - and how - check a database connection online? (1/28/2004 23:53:40)

Any of the old WROX books were good!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.125