Jump to content
Sign in to follow this  
jayeshp100

ASP problem

Recommended Posts

Hi ive got this query below and the table is in SQL Plus,select sum(d.price), e.Title, d.dvd_idfrom dvd_rental d, dvd_details ewhere ORDER_DATE between '4-NOV-04' and '04-NOV-05'and e.dvd_id = d.dvd_idgroup by d.dvd_id, e.titleorder by sum(d.price) descI want to use ASP to simply display the contents in a table using ASP, i know how to do this, but this is a long query how do i insert this query into the ASP, i tried to put it on multiple lines but at the end of the first line theres an error how do i make it so it reads the whole query.

Share this post


Link to post
Share on other sites
Hi ive got this query below and the table is in SQL Plus,select sum(d.price), e.Title, d.dvd_idfrom dvd_rental d, dvd_details ewhere ORDER_DATE between '4-NOV-04' and '04-NOV-05'and e.dvd_id = d.dvd_idgroup by d.dvd_id, e.titleorder by sum(d.price) descI want to use ASP to simply display the contents in a table using ASP, i know how to do this, but this is a long query how do i insert this query into the ASP, i tried to put it on multiple lines but at the end of the first line theres an error how do i make it so it reads the whole query.

Assuming you are asking to concatenate your sqlstatement in vbscript.. Look the sample below.. use _ at end of first line and an & at the start of second line.strSQL = "select sum(d.price), e.Title, d.dvd_id"_&"from dvd_rental d, dvd_details e"_&"where ORDER_DATE between '4-NOV-04' and '04-NOV-05'"_&"and e.dvd_id = d.dvd_id"_&"group by d.dvd_id, e.title"_&"order by sum(d.price) desc"

Share this post


Link to post
Share on other sites
Assuming you are asking to concatenate your sqlstatement in vbscript.. Look the sample below.. use _ at end of first line and an & at the start of second line.strSQL = "select sum(d.price), e.Title, d.dvd_id"_&"from dvd_rental d, dvd_details e"_&"where ORDER_DATE between '4-NOV-04' and '04-NOV-05'"_&"and e.dvd_id = d.dvd_id"_&"group by d.dvd_id, e.title"_&"order by sum(d.price) desc"

Im not using vbscript, just standard SQL, would the above solution be the same.

Share this post


Link to post
Share on other sites
Im not using vbscript, just standard SQL, would the above solution be the same.

ok... You want to query a database and show all the results in a table in asp( I assume u mean active server pages).Do you know what language are you writing your asp pages?If you are writing in VbScript... , set your connectionset your recordset set your sqlstatement. ( if your sql statement has multiple lines use the above syntax)query the database. get the results of the query in a recordset. loop through the recordset to write to a page.

Share this post


Link to post
Share on other sites
ok... You want to query a database and show all the results in a table in asp( I assume u mean active server pages).Do you know what language are you writing your asp pages?If you are writing in VbScript... , set your connectionset your recordset set your sqlstatement. ( if your sql statement has multiple lines use the above syntax)query the database. get the results of the query in a recordset. loop through the recordset to write to a page.

Im using html

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...