|
| |
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 7/28/2002 18:48:20
s2bn1, Questions: Database element: Which database element do you want to show as a hyperlink - field 1, 2, 3...??? Hyperlink Address: What is the hyperlink address you want to use??? Is it stored inside the database or do you want to hand code the link into the hyperlink code??? If you want to hand code it, give me the link address.
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 7/28/2002 18:52:01
s2bn1, Here is a great page for HTML reference. Save and keep it for future reference. It tells you all the commands and definitions. Great page. http://www.sloppycode.net/html/ LLL.
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 7/28/2002 19:19:48
s2bn1, You hit me with many questions. I will tackle one at a time. Lets look at the first one now: You wrote this problem: Third thing is I want to know how make a search using a form. In the sql when I put " id=' ::t1::' " , it is giving me errors. Ok, in your SQL you have it written like this: WHERE id = ' ::t1::' Questions: Is id a field in your database??? Is t1 is an edit field??? What I would do: 1): On the page that you want to conduct the query, place a text field (one line text box) at the very top of the page, above the .ASP script. 2): Give it the " name" : t1. Make sure it is t1 and not tl. 3): Give it an " inital value" of: <%=request(" id" )%>. You can place whatever VALUE you want in place of " id" above. 4): Now test from the first page and post your results to this page. Whatever you passed to this page should now appear in this text box. Your doing this to insure that the value you want passed is passed to this page correctly. Now... 5): At the end of your SQL make sure it says this: WHERE id = ' ::t1::' . 6): Make sure the database your reading HAS an " id" field. The SQL query should now work. Especially if you performed the tests I told you and a value appeared in the text box at the top of the page. If the value did not appear in the textbox at the top of the page then you had a POST transfer problem from page to page. So what happened??? LLL.
|
|
|
|
s2bn1
Posts: 192 Joined: 2/2/2002 From: Dubai United Arab Emirates Status: offline
|
RE: RE: asp page - 7/29/2002 0:37:50
Lune, I will try that.The hyperlink I want is not to a page but it should pass the parameters values.When I used the DRW, the link was like this, <a href=" <%=FP_FieldLink(fp_rs," song_name" )%>" Hope you got it.
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 7/29/2002 16:57:19
s2bn1, OK, it created a line that said this: <a href=" <%=FP_FieldLink(fp_rs," song_name" )%>" ??? I' m getting little confused here. Is this what you have: Page 1: 1): You created a form with fields. 2): The user fills in the fields. 3): You POSTED the form to Page 2. Question: HOW did you handle the form??? Did you POST or GET??? In the Form Properties dialog box did you: a): Send the results to a file. b): Send to Database. c): Send to other. I would have used option (C) above and POSTED the data. Page 2: 1): Create an edit-field just like I told you at the top of the page 2): Give it the name t1. 3): Insert this into the " Initial Value" field: <%=FP_FieldLink(fp_rs," song_name" )%> 4): Test Page 1, fill in the form and click SUBMIT. Do you SEE your song name in the field on page 2??? You SHOULD BE ABLE to SEE the SONG name. 5): Use the database results wizards and create whatever SQL query you want. 6): After the DRW is done, click on your HTML tab and view the HTML. 7): Locate the SQL query it created for you in its two locations: One location will be in GREY, one location will be in BROWN a few lines below it. Use the FP Search routine for " SQL" if you need to. 8): Locate the end of the query and whatever it created for you at the " WHERE" location, replace it with the following: WHERE id = ' ::t1::' . 9): Save the page. 10): Test Page 1 again, fill in the form and click SUBMIT. The SQL DRW query should work now. Was I correct in assuming what you did to create Page 1 and Page 2??? Maybe you should print out this email while testing. Maybe you should create two test pages and try this first to see how it works. Then if it works, apply it to your site. Let me know how it worked. LLL
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 7/29/2002 17:01:17
s2bn1, I forgot one thing. In my last posting to you I wrote this: 8): Locate the end of the query and whatever it created for you at the " WHERE" location, replace it with the following: WHERE id = ' ::t1::' . Change the " id" for whever field in your database your using for the query. I don' t know if your using " id" . We KNOW the t1 value already. So replace the " id" with whatever your using in your search. LLL
|
|
|
|
s2bn1
Posts: 192 Joined: 2/2/2002 From: Dubai United Arab Emirates Status: offline
|
RE: RE: asp page - 7/30/2002 11:05:16
Now I got confused what I want is I got a some songs in a folder.In my database, in one field I entered the song names and in another I gave the path for the particular songs.Now in my asp page, I called the song names and I want to give link to the field where I had given the path, so that when the user click on the song the song should play automatically. It is giving me syntax error when I put WHERE id = ' ::t1::'
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 7/30/2002 11:51:07
s2bn1, Yeah, it is confusing. I am too. Maybe the best thing to do right now is give me the exact web site and web page address to your site, that you are doing this work on. Let me go there and look around to see what you did. That is really the only way to clear the confusion. LLL
|
|
|
|
s2bn1
Posts: 192 Joined: 2/2/2002 From: Dubai United Arab Emirates Status: offline
|
RE: RE: asp page - 7/30/2002 12:06:58
Lune, Could you able to tell how to do this part, 1) I got a some songs in a folder.In my database, in one field I entered the song names and in another I gave the path for the particular songs.Now in my asp page, I called the song names and I want to give link to the field where I had given the path, so that when the user click on the song the song should play automatically. 2) In my page now I had recalled the songs but the link is not there.
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 7/30/2002 12:57:13
s2bn1, Well, according to what you said, you should have a line like this somewhere in the ASP code: <a href=" <%=FP_FieldLink(fp_rs," song_name" )%>" or <a href=" <%=FP_Field(fp_rs," song_name" )%>" These lines take a field value out of your database and assign it to a hyperlink. One of them should work. About playing music, I do not know anything about that. I have never worked with sound files in ASP or VBScript before. I' m beginning to wonder how much help I really am. If I can' t see the actual code, then I cannot help. The code you posted to me a few days ago does not appear in the post/reply list of this site anymore!!! I don' t know why. LLL
|
|
|
|
s2bn1
Posts: 192 Joined: 2/2/2002 From: Dubai United Arab Emirates Status: offline
|
RE: RE: asp page - 7/31/2002 14:03:10
Lune, This is my code, <html> <head> <meta http-equiv=" Content-Type" content=" text/html; charset=windows-1252" > <meta name=" GENERATOR" content=" Microsoft FrontPage 4.0" > <meta name=" ProgId" content=" FrontPage.Editor.Document" > <title>New Page 1</title> </head> <body bgcolor=" #000080" > <% Dim cnnGetRows ' ADO connection Dim rstGetRows ' ADO recordset Dim strDBPath ' Path to our Access DB (*.mdb) file Dim arrDBData,objTableRS ' Array that we dump all the data into Dim I, J Dim iRecFirst, iRecLast Dim iFieldFirst, iFieldLast strDBPath = Server.MapPath(" /s2bt/db/db1.mdb" ) Set cnnGetRows = Server.CreateObject(" ADODB.Connection" ) cnnGetRows.Open " DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & strDBPath & " ;" Set rstGetRows = cnnGetRows.Execute(" SELECT film_name FROM songs where language=' english' " ) arrDBData = rstGetRows.GetRows() rstGetRows.Close Set rstGetRows = Nothing cnnGetRows.Close Set cnnGetRows = Nothing iRecFirst = LBound(arrDBData, 2) iRecLast = UBound(arrDBData, 2) iFieldFirst = LBound(arrDBData, 1) iFieldLast = UBound(arrDBData, 1) %> <div align=" center" > <table border=" 0" cellpadding=" 0" cellspacing=" 0" style=" border-collapse: collapse" bordercolor=" #FFFFFF" width=" 100%" id=" AutoNumber1" > <tr> <td width=" 25%" align=" center" ><b><font color=" #FFFFFF" >Song name</b></td> </tr> <% For I = iRecFirst To iRecLast Response.Write " <TABLE BORDER=0 CELLSPACING=1><TR>" Response.Write " <font color=#FFFFFF>" For J = iFieldFirst To iFieldLast Response.Write " <TABLE BORDER=0 CELLSPACING=1><TR>" Response.Write " <font color=#FFFFFF>" Response.Write vbTab & " <td>" & arrDBData(J, I) & " </td>" & vbCrLf Next ' J Next ' I %> </table> Here where should I insert the hyperlink field and how.
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 7/31/2002 22:46:12
s2bn1, Here are some tips for font type, color, and size: Example 1: <p><font face=" Arial" size=" 4" color=" #FF0000" > This example is an Arial font, size 4 in RED with no attirbutes. </font></p> Example2: <p><u><font face=" Arial" size=" 4" color=" #008000" > This example is an Arial font, size 4 in GREEN with an UNDERLINE attribute. </font></u></p> Example3: <p><b><font face=" Arial" size=" 4" color=" #0000FF" > This example is an Arial font, size 4 in BLUE with a BOLD attribute. </font></b></p> Example4: <p><font face=" Arial" size=" 4" color=" #000000" > <b><u> This example is an Arial font in BLACK with BOLD and UNDERLINE attributes. </u></b></font></p> I would do it like this: <% For J = iFieldFirst To iFieldLast %> <TABLE BORDER=0 CELLSPACING=1><TR> <p><b><font face=" Arial" size=" 4" color=" #0000FF" > <% Response.Write vbTab & " <td>" & arrDBData(J, I) & " </td>" & vbCrLf Next J Next I %> </font></b></p> Or better yet, I might do it like this: <TABLE BORDER=0 CELLSPACING=1><TR> <p><b><font face=" Arial" size=" 4" color=" #0000FF" > <% For J = iFieldFirst To iFieldLast Response.Write vbTab & " <td>" & arrDBData(J, I) & " </td>" & vbCrLf Next ' J Next ' I %> </font></b></p> These two examples used my sample #3 above: BLUE with a BOLD attribute. Try it out. I can see you practically solved these questions but I wanted to give you these code segments anyway. I' ll get back to you with the " where should I insert the hyperlink field and how" question next. LLL
|
|
|
|
s2bn1
Posts: 192 Joined: 2/2/2002 From: Dubai United Arab Emirates Status: offline
|
RE: RE: asp page - 8/1/2002 14:55:46
Lune All these are not changing the font color but I am able to change the font .I think I can do it.But what to do to give the hyperlink.
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 8/1/2002 20:51:02
s2bn1, You can' t get the font color to change??? I don' t understand why the font color wouldn' t change for you. Remember, your changing the font in HTML. Embedded between your ASP code. This should work fine. Why don' t you: cut and copy this HTML code (below), create a test page, click on the HTML tab and paste this in your page. Then view it and see if the font changes. <p><font face=" Arial" size=" 4" color=" #FF0000" > This example is an Arial font, size 4 in RED with no attirbutes. </font></p> <p><u><font face=" Arial" size=" 4" color=" #008000" > This example is an Arial font, size 4 in GREEN with an UNDERLINE attribute. </font></u></p> <p><b><font face=" Arial" size=" 4" color=" #0000FF" > This example is an Arial font, size 4 in BLUE with a BOLD attribute. </font></b></p> <p><font face=" Arial" size=" 4" color=" #000000" > <b><u> This example is an Arial font in BLACK with BOLD and UNDERLINE attributes. </u></b></font></p> I tested it. -------------------------------------------------------------------------------------- Okay, last question: What do you want to link to??? When your user clicks on this link where do you want them to go. Be specific. LLL
|
|
|
|
s2bn1
Posts: 192 Joined: 2/2/2002 From: Dubai United Arab Emirates Status: offline
|
RE: RE: asp page - 8/2/2002 3:38:44
Thankypu Lune it is working.The hyperlink won' t take the user to another page it will just take the field value (When using DRW the hyperlink will be something like as shown before, <a href=" <%=FP_FieldLink(fp_rs," song_name" )%>" ).
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 8/2/2002 6:20:02
s2bn1, I was looking at your code. One more question comes up. In your code, you have this line: Response.Write vbTab & " <td>" & arrDBData(J, I) & " </td>" & vbCrLf Your referencing a 2-dimensional array; " J" represents each record, and " I" represents each field in the record. WHICH field " number" IS the song_name in " I" ??? 0, 1, 2, 3... LLL
|
|
|
|
s2bn1
Posts: 192 Joined: 2/2/2002 From: Dubai United Arab Emirates Status: offline
|
RE: RE: asp page - 8/2/2002 7:47:06
Lune, song name is field 1
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 8/2/2002 12:44:00
s2bn1, Bare with me. This is taking a little time. I am looknig at something like the following right now: <% For I = iRecFirst To iRecLast Response.Write " <TABLE BORDER=0 CELLSPACING=1><TR>" Response.Write " <font color=#FFFFFF>" For J = iFieldFirst To iFieldLast Response.Write " <TABLE BORDER=0 CELLSPACING=1><TR>" Response.Write " <font color=#FFFFFF>" If (J = 1) Response.Write vbTab & " <td>" & <a href=" <%=FP_FieldLink (fp_rs," song_name" )%>" ) & " </td>" & vbCrLf Else Response.Write vbTab & " <td>" & arrDBData(J, I) & " </td>" & vbCrLf End If Next ' J Next ' I %> I need to get the kinks out. Patience is a virtue... LLL
|
|
|
|
s2bn1
Posts: 192 Joined: 2/2/2002 From: Dubai United Arab Emirates Status: offline
|
RE: RE: asp page - 8/3/2002 7:12:19
Lune, It is giving me error in this below line, Response.Write vbTab & " <td>" &<a href=" http://<%=FP_FieldLink(fp_rs," Song_name" )%>" >& " </td>" & vbCrLf
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 8/4/2002 13:15:47
s2bn1, I think I located the problem. You have the following inside your code line: <href=" http://<%=FP_FieldLink(fp_rs," Song_name" )%>" Change it to this: <href=" <%=FP_FieldLink(fp_rs," Song_name" )%>" OR..... <a href=" <%=FP_FieldLink(fp_rs," Song_name" )%>" " http://" (in the link) indicates a world wide web address. You don' t want that. If this does not solve the problem, repost the question. I usually use the DRW for this type of work. I can format the cells however I want, place the correct code where I need it, change colors, resize, change fonts, etc... It' s really the easiest way. I don' t know what else I can tell you. Try the changes I just told you about. Let me know if it worked. If not, maybe you should re-post a new question. Sorry... LLL
|
|
|
|
s2bn1
Posts: 192 Joined: 2/2/2002 From: Dubai United Arab Emirates Status: offline
|
RE: RE: asp page - 8/5/2002 9:41:09
It' s ok Lune I will find it out, don' t worry.
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: asp page - 8/5/2002 15:58:59
s2bn1, Look what I fond on another site. I am enclosing the code. Look at how they did their links: <% Set DBView = Server.CreateObject(" ADODB.Recordset" ) DBView.ActiveConnection = " Driver={Microsoft Access Driver (*.mdb)};DBQ=c:/inetpub/wwwroot/fpdb/blarp.mdb" DBView.cursortype = 1 DBView.Source = " SELECT [from], subject, date, message FROM messages ORDER BY Date DESC" DBView.Open pgs = request.querystring(" page" ) if pgs = " " Then pgs = 1 : rpg = 1 rpg = pgs pgs = ((pgs - 1) * 5) +1 Curre = 0 if Not DBView.EOF Then DBView.Move (pgs - 1) While curre < 5 and Not DBView.EOF %> <TR> <TD width=" 100%" bgcolor=" #800000" ><B><FONT face=" Arial" size=" 3" ><%=(DBView(" Subject" ))%></FONT></B></TD> </TR> <TR> <TD width=" 100%" class=" tbody" align=" right" bgcolor=" #800000" >By: <%=(DBView(" from" ))%><BR>Date: <%=(DBView(" Date" ))%></TD> </TR> <TR> <TD width=" 100%" class=" tbody" ><%=(DBView(" Message" ))%><BR></TD> </TR> <TR><TD width=" 100%" height=" 20" ></TD></TR> <% DBView.MoveNext curre = curre +1 wend End if %> < finish your HTML repeating reigon here, For example, close your table > <TD width=" 100%" bgcolor=" #800000" class=" tbody" >Messages: <B><%=pgs%>-<%=pgs+(curre-1)%> </B>of <B><%=(DBView.RecordCount)%></B></TD></TR> <TR><TD width=" 100%" class=" tbody" > <% pqs = request.querystring(" page" ) if pqs = " " Then pqs = 1 pages = int(dbview.recordcount \ 5) if dbview.recordcount mod 5 <> 0 Then pages = pages + 1 response.write(" Pages: [" ) For AI = 1 To pages if Cint(AI) = cint(pqs) Then response.write " <B>" & ai & " </B> " if cint(AI) <> cint(pqs) Then response.write " <A href=" " blarp.asp?page=" & ai & " " " >" & ai & " </A> " Next response.write (" ]" ) %> Notice NO " http://" in the address. Good Luck LLL
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|