Ask a Question related to ASP Database, Design and Development.
-
HallMonitor89 #1
Searching database problem
Having an issue. Trying to create an ASP search page that queries SQL
2k database based on some set and some variable criteria. The problem,
I think, lies in how I am presenting the SQL statement to the SQL
server. Thanks in advance.
Code follows:
=============
noodle="SELECT Customers.[Company Name], Customers.State,
Schedule.PurchaseType, Schedule.[Equipment Amount] " & _
"FROM Customers INNER JOIN Schedule ON Customers.ID = Schedule.ID " & _
"WHERE (Schedule.PurchaseType) = '" & rEquipmentType & "' "
set WhataRecordset = cn.execute (noodle)
do While Not WhataRecordset.EOF
Response.Write("<tr><td>" & [Customers].[Company Name] & "</td><td>" &
[Customers].[State] & "</td><td>" & _
[Schedule].[PurchaseType] & "</td><td>" & [Schedule].[Equipment Amount]
& "</td></tr>")
WhataRecordset.MoveNext
loop
WhataRecordset.close
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
HallMonitor89 Guest
-
Problem with searching PDF file
Hi guys, Now I face one problem. I use cfidex to search the text in the PDF file. I only can find the PDF file converted from word document . ... -
searching for record before adding to database
Hi all, Im creating a form, and I can now add and save the record. However, since we are concern on duplicate records, I use email as the field... -
Searching A Database Using Greater & Lesser Than
I have a database with a field called "Value" in one of my tables. This field is just set as number. I want to be able to search this field so that... -
Searching MS Database
Hello. I'm trying to develope ASP Javascript pages that search an MS Access Database. The first page of the application offers 4 ways to search,... -
Searching a database .... query optimization (how do I read the explain on output?)
I've got a more-or-less open search of the database in question, which works just fine, if you don't mind the upwards of 20+ seconds it takes to... -
Ray at #2
Re: Searching database problem
It usually helps to say what error you're getting.
<%
do While Not WhataRecordset.EOF
Response.Write("<tr><td>" & WhataRecordset.Fields.Item(0).Value &
"</td><td>" & WhataRecordset.Fields.Item(1).Value & "</td><td>" & _
WhataRecordset.Fields.Item(2).Value & "</td><td>" &
WhataRecordset.Fields.Item(4).Value & "</td></tr>")
%>
You don't use the column names in your ASP code like that. You reference
the columns within the recordset object, either by name, or by numeric
index, starting at 0. In this recordset, index 0 is Company Name, 1 is
State, and so on.
Also, since you're in the beginning of things, assumingly, you should rename
your columns in your database and ditch the spaces...
Ray at work
"HallMonitor89" <nospam@novirus.com> wrote in message
news:ea9HX9CxDHA.2520@TK2MSFTNGP10.phx.gbl...>
>
> Having an issue. Trying to create an ASP search page that queries SQL
> 2k database based on some set and some variable criteria. The problem,
> I think, lies in how I am presenting the SQL statement to the SQL
> server. Thanks in advance.
>
> Code follows:
> =============
>
> noodle="SELECT Customers.[Company Name], Customers.State,
> Schedule.PurchaseType, Schedule.[Equipment Amount] " & _
> "FROM Customers INNER JOIN Schedule ON Customers.ID = Schedule.ID " & _
> "WHERE (Schedule.PurchaseType) = '" & rEquipmentType & "' "
>
> set WhataRecordset = cn.execute (noodle)
> do While Not WhataRecordset.EOF
> Response.Write("<tr><td>" & [Customers].[Company Name] & "</td><td>" &
> [Customers].[State] & "</td><td>" & _
> [Schedule].[PurchaseType] & "</td><td>" & [Schedule].[Equipment Amount]
> & "</td></tr>")
>
> WhataRecordset.MoveNext
> loop
> WhataRecordset.close
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Ray at Guest



Reply With Quote

