i am developing a milt-language dynamic website in Classic ASP.

the site is in English, arabic and French and the data is all stored in an Access database.

my problem is specifically with grabbing the "FRENCH" submenus in a dynamic heir menu:

<script type="text/javascript" language="JavaScript1.2" src="includes/stmenu.js"></script>
<%  
cl="Arabic"
clF="French"
if session("CurrentLanguage")=cl then
	alignment=2
else
	alignment=0
end if
if session("CurrentLanguage")=cl then
	imgext="A"
elseif session("CurrentLanguage")= clF then
	imgext="F"
else
	imgext=""
end if
	Dim rs, rs1, checkusedarr(100)
	Dim Caption,PageId1, PageId2,PageId3, sSub,nSub,bool1,bool2, bool3,check,item,linkishere,linkishere2
	Dim SQLStr
	Dim vitem
	bool1=false
	bool2=false
	bool3=false
	check=0
   set rs=Server.CreateObject("adodb.Recordset")
   set rs1=Server.CreateObject("adodb.Recordset")
  %>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" background="images/piece_14.gif">
        <tr align="center"> 
          <td> 
			<script type="text/javascript" language="JavaScript1.2">
<!--
stm_bm(["menu6b30",600,"","blank.gif",0,"","",<%=alignment%>,0,50,0,100,0,0,0,"","100%",0,0,1,2,"default","hand",""],this);
stm_bp("p0",[0,4,0,0,0,0,-1,0,100,"",-2,"",-2,50,0,0,"#999999","","images/piece_14.gif",1,0,0,""]);
<%
Set rs = cnn.Execute("SELECT * FROM SiteMap WHERE ParentId=1 and active=1")
counter=14
rs.movenext
While Not rs.EOF
response.write counter
'response.end
  PageCaption =  rs("Caption_E")
  PageId1 = rs("PageId")
			for each item in checkusedarr
					if(item=PageId1 ) then
									bool1=true
									exit for
					end if
				next
				if (cbool(bool1)<>true) then
						checkusedarr(check)=PageId1
						check= check+1
                        linkishere="default.asp?PageId="
 %> 
stm_ai("p0i1",[6,1,"#000000","images/Header_Footer1_15.gif",-1,-1,0]);
stm_ai("p0i0",[1,"","","",-1,-1,0,"<%=linkishere%><%=PageId1%>","_self","","","images/header_footer1_<%=counter%><%=imgext%>.gif","images/Header_Footer_on1_<%=counter%><%=imgext%>.gif",-1,-1,0,"","",-1,-1,0,0,1,"#FFFFF7",1,"#FFFFF7",1,"images/piece_14.gif","images/piece_14.gif",1,1,0,0,"","","#000000","#000000","8pt Verdana","8pt Verdana",0,0]);
stm_bp("p1",[1,4,2,2,3,1,0,0,79,"progid:DXImageTransform.Microsoft.RandomDissolve(,enabled=0,Duration=0.15)",12,"progid:DXImageTransform.Microsoft.RandomDissolve(,enabled=0,Duration=0.80)",12,30,1,2,"#999999","#9B2929","",1,5,1,"#000000"]);
<%
Set rs1 = cnn.Execute("SELECT * FROM SiteMap WHERE active=1 and ParentId=" &PageId1)
While Not rs1.EOF
					if session("CurrentLanguage")="English"  then 
								sSub = Rs1(GetFieldName("Caption_E")) & ""
					end if
					if session("CurrentLanguage")=cl then 
								sSub = Rs1(GetFieldName("Caption_A")) & ""
					end if

					if session("CurrentLanguage")=clF  then 
								sSub = Rs1("Caption_F")
					end if  PageId2 = rs1("PageId")
			for each item in checkusedarr
					if(item=PageId2 ) then
									bool1=true
									exit for
					end if
				next
				if (cbool(bool1)<>true) then
								checkusedarr(check)=PageId2
								check= check+1
linkishere2="default.asp?PageId="
 if PageId2 =14 then %>
stm_ai("p1i0",[0,"<%=sSub%>    ","","",-1,-1,0,"former/ged/search.htm","_blank","","","","",0,0,0,"","",0,0,0,<%=alignment%>,1,"#FFFFF7",0,"#FFFFF7",0,"","",1,1,0,0,"#FFFFF7","#000000","#000000","#000000","8pt Verdana","bold 8pt Verdana",0,0]);

<% end if 
 if PageId2 =15 then %>
stm_ai("p1i0",[0,"<%=sSub%>    ","","",-1,-1,0,"former/contactdb/searching.asp","_blank","","","","",0,0,0,"","",0,0,0,<%=alignment%>,1,"#FFFFF7",0,"#FFFFF7",0,"","",1,1,0,0,"#FFFFF7","#000000","#000000","#000000","8pt Verdana","bold 8pt Verdana",0,0]);
<% end if 

 if  PageId2 <> 14 and PageId2 <> 15 and PageId2 <> 45 and PageId2 <> 46 and PageId2 <> 47 and PageId2 <> 48 and PageId2 <> 49 and PageId2 <> 50 and PageId2 <> 51 then %>
stm_ai("p1i0",[0,"<%=sSub%>    ","","",-1,-1,0,"<%=linkishere2%><%=PageId2%>","_self","","","","",0,0,0,"","",0,0,0,<%=alignment%>,1,"#FFFFF7",0,"#FFFFF7",0,"","",1,1,0,0,"#FFFFF7","#000000","#000000","#000000","8pt Verdana","bold 8pt Verdana",0,0]);
<% end if 
 if  PageId2 = 45 or PageId2 = 46 or PageId2 = 47 or PageId2 = 48 or PageId2 = 49 or PageId2 = 50 or PageId2 = 51  then 
Set rs3 = cnn.Execute("SELECT * FROM projects WHERE  PageId=" &PageId2)
While Not rs3.EOF
					if session("CurrentLanguage")="Arabic"  then 
						ProjectTitle = rs3(GetFieldName("ProjectTitle_A")) & ""
					end if
					if session("CurrentLanguage")="French"  then 
						ProjectTitle = rs3("ProjectTitle_F")
					end if
					if session("CurrentLanguage")="English"  then 
						ProjectTitle = rs3(GetFieldName("ProjectTitle_E")) & ""
					end if
%>
stm_ai("p1i0",[0,"<%=sSub%>    ","","",-1,-1,0,"<%=linkishere2%><%=PageId2%>","_self","","<%=ProjectTitle%>","","",0,0,0,"","",0,0,0,<%=alignment%>,1,"#FFFFF7",0,"#FFFFF7",0,"","",1,1,0,0,"#FFFFF7","#000000","#000000","#000000","8pt Verdana","bold 8pt Verdana",0,0]);
<% 
rs3.movenext
wend
end if 
end if
rs1.MoveNext
Wend
%>
stm_ep();
<% end if 
rs.MoveNext
counter=counter+2
Wend%>
stm_ep();
stm_em();
//-->
</script>
		</td>
        </tr>
  <tr> 
    <td background="images/Header_Footer1_27.gif"><img src="images/Header_Footer1_27.gif" width=800 height=3 alt=""></td>
  </tr>
      </table>

the problem lies in the area in red.

the menu works PERFECTLY with english and arabic...but not french.
if i change "caption_F" to "caption_A" or "caption_E" the menu works perfectly and i don't get the "unterminated string constant" error in the task bar below, except of course it grabs the english or arabic submenus !!

BTW the same red script above..works great within the rest of the site !!
HELP HELP HELP

NadaAngel

I think it might have something to do with what it is pulling from the database, write out the sql, maybe there is some double quotes or reserved words in the sql.

but why in THIS specific place only ?
i've used this script all over the site includes-and i call the captions all over the place...why here ???????????????
i'm going crazyy

dont go crazy, these things happen, and sometimes it will be a stupid thing that causes everything to break. But thats the fun of programming. :)

i think it must be the data, try changing the data that is used in the french recordset to the english or arabic one, without changin the code. if that works then it is definitely something in the data.


could also be double quotes somewhere in the string.

Just picked up something else:
shouldnt your hilighted portion look something like:

if session("CurrentLanguage")=cl then 
	sSub = Rs1(GetFieldName("Caption_A")) & ""
end if

if session("CurrentLanguage")=clF  then 
	sSub = Rs1(GetFieldName("Caption_F")) & ""
end if

Hiiiii Thirusha,

i finally got it to work but never had a chance to tell you since.... it was in fact the data :icon_redface: :icon_rolleyes:

the french data had an extra space or quote...something like that....

just imagine... i had to retrieve data from every single cell and retry the page till i found the cell with faulty data....

ppphheewwwwww thank god that's over :)

thank you soooooo much

Glad to help :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.