Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About narrator

  • Rank
  1. Fixed it by changing the sql line to end in this:...WHERE ID="&recid&""But is that the right way to do it, or is there an easier way?Thanks
  2. Hi, could someone please help with the following error:Microsoft JET Database Engine error '80040e07'Data type mismatch in criteria expression./mytest.asp, line 23 In my code below, I need to do 2 things- Use a variable passed from a form to choose the record ID, hence recid- Create a variable for the field data myTxtThe code works when I substitute 3 for recid in the sql line.recid=3set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "myDBpath"set rs=Server.CreateObject("ADODB.recordset")sql="SELECT ID, myTxt FROM myTable WHERE ID=recid" <This
  3. Thanks just.. as I said, I ran into include precedence. if existinclude file containing scriptelseend ifFortunately the top part of the include contained the script, so I just pulled that out and set it into the default file so it executes separate to include. I can see how precedence can do your head in.. lol.
  4. Hi,[Edited for clarity]I want to pass email addresses between pages so they can't be captured by bots. Page1 has people's names within paragraph texts and imagemaps. I'd like users to be able to click on the name, taking them to a form (page2) to send that person an email.examplepage1:Paragraph of text mentioning <link>Jim</link> and why you should contact him, next to image with a part of the image linked the same way.More paragraphs mentioning other people.page2:<h3>Contact Jim</h3> (Jim's name is also passed from page1.)Contact Form<Submit> sends email to JimI'
  5. deleted my reply.. thought i figured it out but hadn't..ran into "include" precedence.. sigh2nd edit:Thinking it through.. is it because at that point it is already executing the asp code and can't read in the cat code and execute it at the same time?
  6. Hi,On my page, it first obtains the current folder name for use as a variable:<%Dim fs,fo,catSet fs=Server.CreateObject("Scripting.FileSystemObject")Set fo=fs.GetFolder(server.MapPath("."))cat=fo.nameset fo=nothingset fs=nothing%>It then correctly uses the "cat" (category) variable at the top of the page within a heading.A little lower, another routine chooses between FileExist else read in another file:<%Set fs=Server.CreateObject("Scripting.FileSystemObject")If (fs.FileExists(Server.MapPath("topleft.inc")))=true ThenSet f=fs.OpenTextFile(Server.MapPath("topleft.inc"), 1)Response.Wri
  7. Woohoo!! Thank You.. it works now. <%Set fs=Server.CreateObject("Scripting.FileSystemObject")If (fs.FileExists(Server.MapPath("body.inc")))=true ThenSet f=fs.OpenTextFile(Server.MapPath("body.inc"), 1)Response.Write(f.ReadAll)f.CloseElseSet f=fs.OpenTextFile(Server.MapPath("../inc/body.inc"), 1)Response.Write(f.ReadAll)f.CloseEnd IfSet f=Nothingset fs=nothing%>
  8. Hi,On my site, categories are organized into folders. When there's no body to the page, I use a standard body ( ../inc/body.inc). If there is a body.inc in the same folder, I want it to use that instead. I created the following code for that purpose, but regardless whether there is a body.inc file within the same folder or not, it only uses my standard body file (../inc/body.inc). What's wrong with the code? I've tried changing "body.inc" in lines 3 and 4 to "./body.inc" and ".\body.inc", neither of which makes any difference. I got the basis for the code from here.<%Set fs=Server.CreateObj
  9. Worked it out. Quite simple really.I learned asp about 8 or 9 years ago... just remembering it now.<%Dim myNummyNum = 6If myNum = 6 Then%><B>hello</B><%Else%><B>not hello</B><%End If%>Cheers
  10. Thanks just,I looked at that page and experimented a little. What I had trouble with was using the "document.write" part to place dozen or more lines of html.Ideally, I'd like to use "include" statements to put in some default content for both parts of the "if" (unless there's another way achieve this).Cheers
  11. From the hosting, it only says asp, asp.net 1.1 and asp.net 2, on IIS 6.0.I could email them and ask for more details if that helps.I'm writing my site in asp and html, with a separate style page.
  12. Found an easy way to do what I wanted<%Dim fs,fo,catSet fs=Server.CreateObject("Scripting.FileSystemObject")Set fo=fs.GetFolder(server.MapPath("."))cat=fo.nameset fo=nothingset fs=nothing%>Tested and seems to work. <%=cat%> produces the current folder name.Does anyone think the above code could create unknown problems?Thanks
  13. Thanks Just...Attempting to use your reply.Struggling, but I understand what the idea.I'll let you know how I get on.
  14. Hi,I'd like to choose between 2 blocks of html, depending on what the variable equals. <if myvar="yes" then>a block of html <else>a different block of html<end if>I've tried coding it a few ways, each time coming up with a syntax error.Your help would be much appreciated :)Thank you
  15. Hi,A site I'm developing will have new folders added regularly. Each folder represents a category. I'd like to use the same template file in each new folder. To save editing the template with the category name each time, I'd like to create a variable which takes the category name from the folder name:myurl/category1/mytemplate.asp > variable = "category1"myurl/category2/mytemplate.asp > variable = "category2"myurl/category3/mytemplate.asp > variable = "category3"Any suggestions gratefully received.Thanks.
  • Create New...