ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 13th, 2009, 02:56 AM
vasanth28 vasanth28 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 4 vasanth28 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 30 sec
Reputation Power: 0
VBScript - Database - General - I could not link the selected records

<%
Dim con,rs,sl

set con=server.CreateObject("ADODB.Connection")
set rs=server.CreateObject("ADODB.Recordset")
con.open Application("db")
sl = "SELECT * FROM projects "
rs.Open sl,con

Do While Not rs.EOF
Response.Write rs("Tittle") & " " & "<br>"
rs.MoveNext
Loop
rs.Close
con.Close%>
hi the above code is used to select the titles from a table projects ..what im unable to do is ..i have to display the records in a td and i have to use a marquee tool.when i click ever single name a text file stored with that project name should get opened ..can anyone help me for that ..i need it urgently ..explain me the path that should be given to..thank u

Reply With Quote
  #2  
Old November 13th, 2009, 03:04 AM
Jonathan8146 Jonathan8146 is offline
Contributing User
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2005
Posts: 1,878 Jonathan8146 User rank is Captain (20000 - 30000 Reputation Level)Jonathan8146 User rank is Captain (20000 - 30000 Reputation Level)Jonathan8146 User rank is Captain (20000 - 30000 Reputation Level)Jonathan8146 User rank is Captain (20000 - 30000 Reputation Level)Jonathan8146 User rank is Captain (20000 - 30000 Reputation Level)Jonathan8146 User rank is Captain (20000 - 30000 Reputation Level)Jonathan8146 User rank is Captain (20000 - 30000 Reputation Level)Jonathan8146 User rank is Captain (20000 - 30000 Reputation Level)Jonathan8146 User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 20 h 41 m 50 sec
Reputation Power: 301
Quote:
Originally Posted by vasanth28
<%
Dim con,rs,sl

set con=server.CreateObject("ADODB.Connection")
set rs=server.CreateObject("ADODB.Recordset")
con.open Application("db")
sl = "SELECT * FROM projects "
rs.Open sl,con

Do While Not rs.EOF
Response.Write rs("Tittle") & " " & "<br>"
rs.MoveNext
Loop
rs.Close
con.Close%>
hi the above code is used to select the titles from a table projects ..what im unable to do is ..i have to display the records in a td and i have to use a marquee tool.when i click ever single name a text file stored with that project name should get opened ..can anyone help me for that ..i need it urgently ..explain me the path that should be given to..thank u

I guess div and css. Initially the text is hidden then when you click the item the relevant div is displayed and other divs get hidden.

Reply With Quote
  #3  
Old November 13th, 2009, 03:23 AM
vasanth28 vasanth28 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 4 vasanth28 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 30 sec
Reputation Power: 0
Quote:
Originally Posted by Jonathan8146
I guess div and css. Initially the text is hidden then when you click the item the relevant div is displayed and other divs get hidden.






..jonathan i wana know hw to set the link inside the while loop thats the problem.my text file are saved in E:/jp/textfiles/.txt
hw to set the link for that can u help me

Reply With Quote
  #4  
Old November 13th, 2009, 03:48 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,632 sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 3 Days 15 h 14 m 45 sec
Reputation Power: 1909
If I understand you correctly you can do something like this, in the example I am assuming that the fielname is held in a field called file_name:
Code:
<%
Dim con,rs,sl

set con=server.CreateObject("ADODB.Connection")
set rs=server.CreateObject("ADODB.Recordset")
con.open Application("db") 
sl = "SELECT * FROM projects "
rs.Open sl,con

Do While Not rs.EOF
	Response.Write("<a href=""E:\jp\textfiles\" & rs.Fields("file_name") & ".txt"" target=""_blank"">" & rs("Tittle") & "</a>")
	rs.MoveNext
Loop
rs.Close
con.Close
%>

Reply With Quote
  #5  
Old November 13th, 2009, 11:09 PM
vasanth28 vasanth28 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 4 vasanth28 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 30 sec
Reputation Power: 0
Quote:
Originally Posted by sync_or_swim
If I understand you correctly you can do something like this, in the example I am assuming that the fielname is held in a field called file_name:
Code:
<%
Dim con,rs,sl

set con=server.CreateObject("ADODB.Connection")
set rs=server.CreateObject("ADODB.Recordset")
con.open Application("db") 
sl = "SELECT * FROM projects "
rs.Open sl,con

Do While Not rs.EOF
	Response.Write("<a href=""E:\jp\textfiles\" & rs.Fields("file_name") & ".txt"" target=""_blank"">" & rs("Tittle") & "</a>")
	rs.MoveNext
Loop
rs.Close
con.Close
%>




hi swim u did understand my requirement now im able to set the link but when i click that the text files does open ..i have stored my text files in E:\jp\textfiles.were i have stored four text files ..help me with that.

Reply With Quote
  #6  
Old November 14th, 2009, 01:18 AM
vasanth28 vasanth28 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 4 vasanth28 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 30 sec
Reputation Power: 0
Quote:
Originally Posted by vasanth28
hi swim u did understand my requirement now im able to set the link but when i click that the text files does open ..i have stored my text files in E:\jp\textfiles.were i have stored four text files ..help me with that.



if i use urs the error says
either BOF OR EOF should be true or the current record is deleted but i have records in that field

Reply With Quote
  #7  
Old November 14th, 2009, 03:54 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,632 sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 3 Days 15 h 14 m 45 sec
Reputation Power: 1909
Hi,

I think you will have to approach this slightly differently, have the link take the user to a new page and use the filesystemobject to display the contents of the textfile. First, change the link so that it passes the name of the file as a querystring:
Code:
<%
Dim con,rs,sl

set con=server.CreateObject("ADODB.Connection")
set rs=server.CreateObject("ADODB.Recordset")
con.open Application("db") 
sl = "SELECT * FROM projects "
rs.Open sl,con

Do While Not rs.EOF
	Response.Write("<a href=""displayfile.asp?whichfile=" & rs.Fields("file_name") & ".txt"" target=""_blank"">" & rs("Tittle") & "</a>")
	rs.MoveNext
Loop
rs.Close
con.Close
%>

This link will open displayfile.asp in a new window, add the following code to displayfile.asp:
Code:
'Not Tested!!
set fso = createobject("scripting.filesystemobject")

Dim u_file
u_file = "E:\jp\textfiles\" & Request.Querystring("whichfile")

if fso.FileExists (u_file) then 
	' Open the file and read it
	set act = fso.opentextfile(u_file)
	read_text = act.readall
	act.close

	' Write the contents of the document ot the browser
	Response.Write "<pre>" & server.htmlencode(read_text) & "</pre>"

	' If the file in the querystring does not exist
	' Display and eror message
else 
	%>
	There was a problem displaying the requested item<br>
	Please go <a href=<%= request.servervariables("script_name")%>>back</a> and select again<%

	' End check for file existence
end if 
%>

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > VBScript - Database - General - I could not link the selected records


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek