|
|
|
date: Thu, 18 Sep 2008 02:33:04 -0700,
group: microsoft.public.frontpage.client
back
Re: Debugging
Hello Stefan
did read your suggestions, for which I'm very thankful. I tried what you
said - actually I'm relatively new to this and (to be honest) did not really
understand what I'm doing - and still dont understand in detail what you ment.
Just for security I send to you the complete code with the hope that you can
point me with some easier to understand words in the right direction.
CODE:
<!--#include File ="globalsub.asp"-->
<%
If Request.QueryString("dbcmd")="new" then
response.redirect "contactos_web.asp?cmd=New"
End if
If Request.QueryString("dbcmd")="delete" then
Set conntemp = server.CreateObject("adodb.Connection")
conntemp.open
"DSN=access;Database=f:\www.bellfield-barna.com\salespersonal\websales.mdb"
SqlStr = "DELETE FROM contactos_1001 WHERE autonumber="+
Request.QueryString("db_autonumber")
conntemp.Execute (SqlStr)
conntemp.Close
SqlStr=""
End if
If Request.QueryString("dbcmd")="save" then
Set conntemp = server.CreateObject("adodb.Connection")
conntemp.open
"DSN=access;Database=f:\www.bellfield-barna.com\salespersonal\websales.mdb"
SqlStr = "UPDATE contactos_1001 SET "
Sqlstr=SqlStr+"firstname='"+FixDbFieldSave(Request.QueryString("db_firstname")) + "', "
Sqlstr=SqlStr+"lastname='"+FixDbFieldSave(Request.QueryString("db_lastname"))
+ "', "
Sqlstr=SqlStr+"telephone='"+FixDbFieldSave(Request.QueryString("db_telephone")) + "', "
Sqlstr=SqlStr+"mobilephone='"+FixDbFieldSave(Request.QueryString("db_mobilephone")) + "', "
Sqlstr=SqlStr+"sendbrochure="+Request.QueryString("db_sendbrochure") + ", "
Sqlstr=SqlStr+"sendpostvisit="+Request.QueryString("db_sendpostvisit") +
", "
Sqlstr=SqlStr+"information='"+FixDbFieldSave(Request.QueryString("db_information")) + "', "
SqlStr = Mid(SqlStr, 1, Len(SqlStr) - 2)
SqlStr = SqlStr + " WHERE autonumber="+
Request.QueryString("db_autonumber")+ " "
If Instr(sqlstr," SE ")<=0 Then
conntemp.Execute (SqlStr)
End if
conntemp.close
SqlStr=""
End if
gui = request.querystring("gui")
curpage = request.querystring("Curpage")
If Curpage = "" Then Curpage = 1
Interval = request.querystring("Interval")
If Interval = "" Then Interval = 5
prefix=trim(Request.querystring("prefix"))
If prefix = "" then
prefix = "*"
End if
prefix_Operator=trim(Request.querystring("prefix_Operator"))
If prefix_Operator = "" then
prefix_Operator = "OR"
End if
If prefix_Operator = "OR" then
prefix_Operator_ORvar=" checked"
prefix_Operator_ANDvar=""
Else
prefix_Operator_ORvar=""
prefix_Operator_ANDvar=" checked"
End if
If (prefix<>"") And (prefix <> "*") then
SqlStr = SqlStr+"prefix LIKE '%"+prefix+"%' " + prefix_Operator + " "
End if
If SqlStr <> "" Then
SqlStrCount = "SELECT Count(autonumber) As NoOfRecs FROM contactos_1001
Where "+ SqlStr
SqlStrCount = Mid(SqlStrCount,1,len(SqlStrCount)-4)
Else
SqlStrCount = "SELECT Count(autonumber) As NoOfRecs FROM contactos_1001"
End if
If SqlStr <> "" Then
SqlStr ="SELECT * FROM contactos_1001 WHERE "+ SqlStr
SqlStr = Mid(SqlStr,1,len(SqlStr)-4)
Else
Sqlstr ="SELECT * FROM contactos_1001"
End if
SqlStr = SqlStr + " ORDER BY autonumber"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="ATAF Version 6.1.0">
<title>Contactosweb</title>
<base target="_self">
<link rel="stylesheet" type="text/css" href="globalcss.css">
<script Language="JavaScript">
function winopenexcel (sqlstr)
{
msg=open("","NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=150");
msg.location = "toexcel.asp?sqlstr="+sqlstr;
msg.focus()
}
</script>
</head>
<body class="formpage" topmargin="0" leftmargin="0" rightmargin="0"
bottommargin="0" marginwidth="0" marginheight="0" style="background-color:
#DFDFDF">
<table width="556" border="0" height="399">
<tr>
<td></tr>
<td></tr>
<td height="2"></td>
</tr>
<tr>
<td></td>
<td align="left"><img border="0" src="../../../BIE/images/c1_top.GIF"
width="556" height="17"></td>
<td height="21"></td>
</tr>
<tr>
<td></td>
<td valign="Default" >
<form method="GET" action="contactos_web.asp" name="contactos_1001"
onSubmit="return Checkform(this);">
<table border="0" cellpadding="0" cellspacing="0" class="formpagetable"
width="556" style="border-width: 0">
<tr>
<td colspan="2">
<table width="552" border="0">
</table>
<tr><td colspan="2" align="centre" class="listpagetablelabel" height="19">
<p align="center">
<input type="submit" value="Lista" Class="listpagebutton"
<%=ShowTextOnPic("Chasquido aquà para poner sus archivos en una lista")%>>
Ver<%=CreateDropDownBox(Cstr(interval), "5;10", "interval", "1",
"class='listpagetablelabel'", Cstr(interval))%> Archivos por página
</td>
</tr>
<p align="left"></td></tr>
<input type="hidden" name="cmd" value="Find">
</table>
</form>
<table border="0" cellpadding="0" cellspacing="0">
<%
If (Request.Querystring("cmd")="Find") Then
Set conntemp = server.CreateObject("adodb.Connection")
conntemp.open
"DSN=access;Database=f:\www.bellfield-barna.com\salespersonal\websales.mdb"
Set rs = conntemp.Execute(SqlStrCount)
NoOfRecs = rs("NoOfRecs")
Set rs = conntemp.Execute(SqlStr)
If rs.EOF <> True Then
End If
If CInt(curpage) > 1 Then
MoveForward = CInt(Interval) * (CInt(curpage) - 1)
For xx = 1 To MoveForward
If rs.EOF <> True Then
rs.MoveNext
End If
Next
End If
End if
If (Request.Querystring("cmd")="Find") Then
If (rs.EOF<>True) Then
Response.write " <tr class='listpageresultheader'>"
Response.write "<td></td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
class="+qu+"listsave"+qu+">"
Response.write "Nombre"
Response.write " </td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
class="+qu+"listsave"+qu+">"
Response.write "Apellido"
Response.write " </td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
class="+qu+"listsave"+qu+">"
Response.write "Teléfono"
Response.write " </td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
class="+qu+"listsave"+qu+">"
Response.write "Movil"
Response.write " </td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
class="+qu+"listsave"+qu+">"
Response.write "Bro."
Response.write " </td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
class="+qu+"listsave"+qu+">"
Response.write "Carta"
Response.write " </td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
class="+qu+"listsave"+qu+">"
Response.write "Informaciön"
Response.write " </td>"
Response.write "<td></td>"
Response.write "</tr>"
End if
End if
countrecs=0
If (Request.Querystring("cmd")="Find") Then
If (rs.EOF=True) Then
Response.write "¡Lamentable!, ningunos archivos encontrados"
End if
End if
If (Request.Querystring("cmd")="Find") Then
While (rs.EOF <> True) And (Request.Querystring("cmd")="Find") AND
(countrecs<CInt(Interval))
If lastWas = True Then
Varclass = "listpageresultline"
lastWas = False
Else
Varclass = "listpageresultlinealt"
lastWas = True
End If
Response.write "<form method="+qu+"GET"+qu+"
name="+qu+"db"+CStr(Rs("autonumber"))+qu+" target="+qu+"_self"+qu+">"
Response.write "<input type="+qu+"hidden"+qu+"
name="+qu+"db_autonumber"+qu+" value="+qu+CStr(Rs("autonumber"))+qu+">"
Response.write "<input type="+qu+"hidden"+qu+" name="+qu+"dbcmd"+qu+"
value="+qu+"save"+qu+">"
For Each Item In request.querystring
If (Item <> "dbcmd") And (Mid(item,1,3)<>"db_") Then
Response.Write "<input type="+qu+"hidden"+qu+" name="+qu+item+qu+"
value="+qu+request.querystring(Item)+qu+">"
End If
Next
Response.write "<tr title="+qu+"Chasquido aquà para corregir registro"+qu+"
class="+qu+varclass+qu+"
onClick="+qu+"db"+CStr(Rs("autonumber"))+".select_button.className
='listbutselect';"+qu+"
onMouseout="+qu+"db"+CStr(Rs("autonumber"))+".select_button.className
='listbutnotselect';"+qu+">"
Response.write "<td><input type="+qu+"button"+qu+" value="+qu+" "+qu+"
name="+qu+"select_button"+qu+"
onClick="+qu+"window.top.frames['I1'].location.href='contactos_1001form.asp?cmd=Fromlist&autonumber="+CStr(Rs("autonumber"))+"'"+qu+"></td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
name="+qu+"db_firstname"+qu+" value="+qu+FillEmpty(rs("firstname"))+qu+"
size="+qu+"8"+qu+">"
Response.write "</td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
name="+qu+"db_lastname"+qu+" value="+qu+FillEmpty(rs("lastname"))+qu+"
size="+qu+"17"+qu+">"
Response.write "</td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
name="+qu+"db_telephone"+qu+" value="+qu+FillEmpty(rs("telephone"))+qu+"
size="+qu+"15"+qu+">"
Response.write "</td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
name="+qu+"db_mobilephone"+qu+" value="+qu+FillEmpty(rs("mobilephone"))+qu+"
size="+qu+"15"+qu+">"
Response.write "</td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
name="+qu+"db_sendbrochure"+qu+"
value="+qu+FillEmpty(rs("sendbrochure"))+qu+" size="+qu+"2"+qu+">"
Response.write "</td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
name="+qu+"db_sendpostvisit"+qu+"
value="+qu+FillEmpty(rs("sendpostvisit"))+qu+" size="+qu+"2"+qu+">"
Response.write "</td>"
Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
name="+qu+"db_information"+qu+" value="+qu+FillEmpty(rs("information"))+qu+"
size="+qu+"18"+qu+">"
Response.write "</td>"
Response.write "</td><td>"
Response.write "</td>"
Response.write "</form>"
Response.write "</tr>"+Crlf
countrecs=countrecs+1
Rs.movenext
Wend
End if
If (Request.Querystring("cmd")="Find") Then
rs.Close
Set rs = Nothing
conntemp.Close
Set conntemp = Nothing
End if
%>
</table>
<%
If (Request.Querystring("cmd")="Find") Then%>
<center>
<div align="center">
<%=IntervalBox(curpage, Interval, NoOfRecs, "contactos_web.asp",
request.querystring, "#000000", "2")%>
</center>
</div>
<%End If
%>
</td><td height="45"></td>
</tr>
<tr>
<td></td>
<td> </td>
<td height="239"></td>
</tr>
<tr>
<td valign="top" align="middle" width="4"></td><td width="552"></td>
<td height="80" width="0"></td>
</tr>
</table>
<script language="JavaScript">
<!--
function Checkform(thisform) {
// Init val
strError = 'ATAF Version 6.1.0, Database : contactos_web\n\nYou have to
correct the following error(s)\nbefore you can start your search.\n\n';
intError = 0;
if (intError == 1) {
alert (strError)
return false;
}
}
// -->
</script>
<%
If Err <> 0 Then
pad="Sql Script Errors Occured!\n"
pad = pad + "Error Number= #" & Err.Number & "\n"
pad = pad + "Error Desc.= " & Err.Description &"\n\n"
pad = pad + "Data not saved !!!\n"
pad=Replace(pad,"'","´")
response.write "<script language="+qu+"JavaScript"+qu+">"+CrLf
response.write "<!--"+CrLf
response.write "strError = '"+pad+"';"+Crlf
response.write "alert (strError);"+CrLf
response.write "// -->"+CrLf
response.write "</script>"+CrLf
End If
If Session("Err") <> 0 Then
pad="Sql Script Errors Occured!\n"
pad=pad + "Error Number= #<b>" & Session("Err") & "\n"
pad=pad + "Error Desc.= <b>" & Session("Description") &"\n\n"
pad = pad + "Data not saved !!!\n"
pad=Replace(pad,"'","´")
response.write "<script language="+qu+"JavaScript"+qu+">"+CrLf
response.write "<!--"+CrLf
response.write "strError = '"+pad+"';"+Crlf
response.write "alert (strError);"+CrLf
response.write "// -->"+CrLf
response.write "</script>"+CrLf
Session("Err")=0
End If
%>
</body>
</html>
"Stefan B Rusynko" wrote:
> You are using the following general syntax for your buttons
> (broken up by the button tag parameters)
>
> <input
> type="button"
> value="text"
> onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=First&autonumber=X' "
> <%=ShowTextOnPic("Some text here")%>
> Class="formpagebutton">
>
> It appears your client side code is properly delimited
> (with appropriate single and/or double quotes where needed)
>
> The server side Function <%=ShowTextOnPic("Some text here")%> must evaluate correctly server side
> - as a valid client side attribute of the input tag
>
> Without seeing the ASP server side Function in your page ShowTextOnPic()
> - it is hard to debug your server side code
> - but it needs to write (server side) a valid form tag attribute
> (like say: title="Some text here")
>
> Test your Function first (on a ASP page w/ just the function returns) with your string variables to verify it is working
> <%
> pictext1 = ShowTextOnPic("Chasquido para ir al primer registro")
> Response .write pictext1
> '...etc
> %>
>
> PS
> You could also do all your server side code evaluation of the functions using the same technique
> <%
> pictext1 = ShowTextOnPic("Chasquido para ir al primer registro")
> %>
> And in your buttons as say:
> <input type="button" value="text" onClick="... " <%=pictext1%> Class="formpagebutton">
>
> --
>
> _____________________________________________
> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> "Warning - Using the F1 Key will not break anything!" (-;
> _____________________________________________
>
>
> "Amateur" wrote in message news:42E06C15-18AF-477D-88E5-F139E2AE7F4C@microsoft.com...
> | Dear Sirs,
> | If I preview my ASP page I receive an error "unterminated string error" for
> | most of the follwing code lines:
> |
> | <tr><td align="center" colspan="3">
> | <p>
> | <% If cmd<>"New" And cmd<>"Copy" Then %>
> | <input type="button" value="æ<"
> | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=First&autonumber=<%=Session("autonumber")%>'"
> | <%=ShowTextOnPic("Chasquido para ir al primer registro")%>
> | Class="formpagebutton">
> | <input type="button" value="<<"
> | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Prev&autonumber=<%=Session("autonumber")%>'"
> | <%=ShowTextOnPic("Mueva un registro hacia atrás")%> Class="formpagebutton">
> | <input type="text" size="8" Value="<%=Session("CurRec")%> de
> | <%=Session("NumOfRecs")%>" Class="formpagebutton">
> | <input type="button" value=">>"
> | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Next&autonumber=<%=Session("autonumber")%>'"
> | <%=ShowTextOnPic("Chasquido para ir para registrar después")%>
> | Class="formpagebutton">
> | <input type="button" value=">æ"
> | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Last&autonumber=<%=Session("autonumber")%>'"
> | <%=ShowTextOnPic("Chasquido para ir al último registro")%>
> | Class="formpagebutton">
> | <p>
> |
> | <input type="submit" value="Ahorrar" <%=ShowTextOnPic("Chasquido aquÃÂ para
> | salvar sus cambios")%> Class="formpagebutton">
> | <input type="button" value="Borrar"
> | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Del&autonumber=<%=Session("autonumber")%>'"
> | <%=ShowTextOnPic("Chasquido para borrar el registro corriente")%>
> | Class="formpagebutton">
> | <input type="button" value="Nuevo"
> | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=New&autonumber=<%=Session("autonumber")%>'"
> | <%=ShowTextOnPic("Chasquido para crear un nuevo registro")%>
> | Class="formpagebutton" style="float: right">
> | <input type="button" value="Print"
> | onClick="parent.location='contactos_list.asp?cmd=Fromlist&autonumber=<%=CStr(Session("autonumber"))%>'"
> | <%=ShowTextOnPic("Click here to print the current record")%>
> | Class="formpagebutton"><input type="hidden" name="autonumber"
> | value="<%=session("autonumber")%>">
> | <input type="Hidden"name="cmd" value="Save">
> | <% Else %>
> | <input type="submit" value="Ahorrar" <%=ShowTextOnPic("Chasquido para salvar
> | el nuevo registro")%> Class="formpagebutton">
> | <input type="button" value="Anular"
> | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp'"
> | <%=ShowTextOnPic("Chasquido para anular creación de un nuevo registro")%>
> | Class="formpagebutton">
> | <input type="hidden" name="cmd" value="SaveNew">
> | <%End If %>
> | </td></tr>
> |
> | Can someone tell me what that means and how to debug that?
> |
> | Thanks
> | Klaus
>
>
>
date: Fri, 19 Sep 2008 04:27:01 -0700
author: Amateur
Re: Debugging
None of the code provided includes the code for the Function you created called ShowTextOnPic
- it is probably in the include file globalsub.asp
Find the Function there and post the code
As for all you other code it is to extensive for debugging in any newsgroup
Since you say you are relatively new to ASP
- it looks like the code you posted was created by someone else or some downloaded template
(suggest you restart with the unmodified code and test after every change you make to see where the error was introduced)
For more help see http://www.w3schools.com/asp/default.asp
--
_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________
"Amateur" wrote in message news:6EF77841-02B6-420A-85C0-5201F2485AC7@microsoft.com...
| Hello Stefan
|
| did read your suggestions, for which I'm very thankful. I tried what you
| said - actually I'm relatively new to this and (to be honest) did not really
| understand what I'm doing - and still dont understand in detail what you ment.
| Just for security I send to you the complete code with the hope that you can
| point me with some easier to understand words in the right direction.
|
| CODE:
|
| <!--#include File ="globalsub.asp"-->
| <%
|
| If Request.QueryString("dbcmd")="new" then
| response.redirect "contactos_web.asp?cmd=New"
| End if
| If Request.QueryString("dbcmd")="delete" then
| Set conntemp = server.CreateObject("adodb.Connection")
| conntemp.open
| "DSN=access;Database=f:\www.bellfield-barna.com\salespersonal\websales.mdb"
| SqlStr = "DELETE FROM contactos_1001 WHERE autonumber="+
| Request.QueryString("db_autonumber")
| conntemp.Execute (SqlStr)
| conntemp.Close
| SqlStr=""
| End if
|
| If Request.QueryString("dbcmd")="save" then
| Set conntemp = server.CreateObject("adodb.Connection")
| conntemp.open
| "DSN=access;Database=f:\www.bellfield-barna.com\salespersonal\websales.mdb"
| SqlStr = "UPDATE contactos_1001 SET "
|
| Sqlstr=SqlStr+"firstname='"+FixDbFieldSave(Request.QueryString("db_firstname")) + "', "
|
| Sqlstr=SqlStr+"lastname='"+FixDbFieldSave(Request.QueryString("db_lastname"))
| + "', "
|
| Sqlstr=SqlStr+"telephone='"+FixDbFieldSave(Request.QueryString("db_telephone")) + "', "
|
| Sqlstr=SqlStr+"mobilephone='"+FixDbFieldSave(Request.QueryString("db_mobilephone")) + "', "
| Sqlstr=SqlStr+"sendbrochure="+Request.QueryString("db_sendbrochure") + ", "
| Sqlstr=SqlStr+"sendpostvisit="+Request.QueryString("db_sendpostvisit") +
| ", "
|
| Sqlstr=SqlStr+"information='"+FixDbFieldSave(Request.QueryString("db_information")) + "', "
| SqlStr = Mid(SqlStr, 1, Len(SqlStr) - 2)
| SqlStr = SqlStr + " WHERE autonumber="+
| Request.QueryString("db_autonumber")+ " "
| If Instr(sqlstr," SE ")<=0 Then
| conntemp.Execute (SqlStr)
| End if
| conntemp.close
| SqlStr=""
| End if
| gui = request.querystring("gui")
| curpage = request.querystring("Curpage")
| If Curpage = "" Then Curpage = 1
| Interval = request.querystring("Interval")
| If Interval = "" Then Interval = 5
| prefix=trim(Request.querystring("prefix"))
| If prefix = "" then
| prefix = "*"
| End if
| prefix_Operator=trim(Request.querystring("prefix_Operator"))
| If prefix_Operator = "" then
| prefix_Operator = "OR"
| End if
| If prefix_Operator = "OR" then
| prefix_Operator_ORvar=" checked"
| prefix_Operator_ANDvar=""
| Else
| prefix_Operator_ORvar=""
| prefix_Operator_ANDvar=" checked"
| End if
| If (prefix<>"") And (prefix <> "*") then
| SqlStr = SqlStr+"prefix LIKE '%"+prefix+"%' " + prefix_Operator + " "
| End if
| If SqlStr <> "" Then
| SqlStrCount = "SELECT Count(autonumber) As NoOfRecs FROM contactos_1001
| Where "+ SqlStr
| SqlStrCount = Mid(SqlStrCount,1,len(SqlStrCount)-4)
| Else
| SqlStrCount = "SELECT Count(autonumber) As NoOfRecs FROM contactos_1001"
| End if
| If SqlStr <> "" Then
| SqlStr ="SELECT * FROM contactos_1001 WHERE "+ SqlStr
| SqlStr = Mid(SqlStr,1,len(SqlStr)-4)
| Else
| Sqlstr ="SELECT * FROM contactos_1001"
| End if
| SqlStr = SqlStr + " ORDER BY autonumber"
| %>
| <html>
| <head>
| <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
| <meta name="GENERATOR" content="ATAF Version 6.1.0">
| <title>Contactosweb</title>
| <base target="_self">
| <link rel="stylesheet" type="text/css" href="globalcss.css">
|
| <script Language="JavaScript">
| function winopenexcel (sqlstr)
| {
|
msg=open("","NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=150");
| msg.location = "toexcel.asp?sqlstr="+sqlstr;
| msg.focus()
| }
| </script>
|
| </head>
| <body class="formpage" topmargin="0" leftmargin="0" rightmargin="0"
| bottommargin="0" marginwidth="0" marginheight="0" style="background-color:
| #DFDFDF">
| <table width="556" border="0" height="399">
| <tr>
| <td></tr>
| <td></tr>
| <td height="2"></td>
| </tr>
| <tr>
| <td></td>
| <td align="left"><img border="0" src="../../../BIE/images/c1_top.GIF"
| width="556" height="17"></td>
| <td height="21"></td>
| </tr>
| <tr>
| <td></td>
| <td valign="Default" >
| <form method="GET" action="contactos_web.asp" name="contactos_1001"
| onSubmit="return Checkform(this);">
|
| <table border="0" cellpadding="0" cellspacing="0" class="formpagetable"
| width="556" style="border-width: 0">
| <tr>
| <td colspan="2">
| <table width="552" border="0">
|
| </table>
| <tr><td colspan="2" align="centre" class="listpagetablelabel" height="19">
| <p align="center">
| <input type="submit" value="Lista" Class="listpagebutton"
| <%=ShowTextOnPic("Chasquido aquà para poner sus archivos en una lista")%>>
| Ver<%=CreateDropDownBox(Cstr(interval), "5;10", "interval", "1",
| "class='listpagetablelabel'", Cstr(interval))%> Archivos por página
| </td>
| </tr>
|
| <p align="left"></td></tr>
| <input type="hidden" name="cmd" value="Find">
| </table>
| </form>
| <table border="0" cellpadding="0" cellspacing="0">
| <%
| If (Request.Querystring("cmd")="Find") Then
| Set conntemp = server.CreateObject("adodb.Connection")
| conntemp.open
| "DSN=access;Database=f:\www.bellfield-barna.com\salespersonal\websales.mdb"
| Set rs = conntemp.Execute(SqlStrCount)
| NoOfRecs = rs("NoOfRecs")
| Set rs = conntemp.Execute(SqlStr)
| If rs.EOF <> True Then
| End If
| If CInt(curpage) > 1 Then
| MoveForward = CInt(Interval) * (CInt(curpage) - 1)
| For xx = 1 To MoveForward
| If rs.EOF <> True Then
| rs.MoveNext
| End If
| Next
| End If
| End if
| If (Request.Querystring("cmd")="Find") Then
| If (rs.EOF<>True) Then
| Response.write " <tr class='listpageresultheader'>"
| Response.write "<td></td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
| class="+qu+"listsave"+qu+">"
| Response.write "Nombre"
| Response.write " </td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
| class="+qu+"listsave"+qu+">"
| Response.write "Apellido"
| Response.write " </td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
| class="+qu+"listsave"+qu+">"
| Response.write "Teléfono"
| Response.write " </td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
| class="+qu+"listsave"+qu+">"
| Response.write "Movil"
| Response.write " </td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
| class="+qu+"listsave"+qu+">"
| Response.write "Bro."
| Response.write " </td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
| class="+qu+"listsave"+qu+">"
| Response.write "Carta"
| Response.write " </td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
| class="+qu+"listsave"+qu+">"
| Response.write "Informaciön"
| Response.write " </td>"
| Response.write "<td></td>"
| Response.write "</tr>"
| End if
| End if
| countrecs=0
| If (Request.Querystring("cmd")="Find") Then
| If (rs.EOF=True) Then
| Response.write "¡Lamentable!, ningunos archivos encontrados"
| End if
| End if
| If (Request.Querystring("cmd")="Find") Then
| While (rs.EOF <> True) And (Request.Querystring("cmd")="Find") AND
| (countrecs<CInt(Interval))
| If lastWas = True Then
| Varclass = "listpageresultline"
| lastWas = False
| Else
| Varclass = "listpageresultlinealt"
| lastWas = True
| End If
| Response.write "<form method="+qu+"GET"+qu+"
| name="+qu+"db"+CStr(Rs("autonumber"))+qu+" target="+qu+"_self"+qu+">"
| Response.write "<input type="+qu+"hidden"+qu+"
| name="+qu+"db_autonumber"+qu+" value="+qu+CStr(Rs("autonumber"))+qu+">"
| Response.write "<input type="+qu+"hidden"+qu+" name="+qu+"dbcmd"+qu+"
| value="+qu+"save"+qu+">"
| For Each Item In request.querystring
| If (Item <> "dbcmd") And (Mid(item,1,3)<>"db_") Then
| Response.Write "<input type="+qu+"hidden"+qu+" name="+qu+item+qu+"
| value="+qu+request.querystring(Item)+qu+">"
| End If
| Next
| Response.write "<tr title="+qu+"Chasquido aquà para corregir registro"+qu+"
| class="+qu+varclass+qu+"
| onClick="+qu+"db"+CStr(Rs("autonumber"))+".select_button.className
| ='listbutselect';"+qu+"
| onMouseout="+qu+"db"+CStr(Rs("autonumber"))+".select_button.className
| ='listbutnotselect';"+qu+">"
| Response.write "<td><input type="+qu+"button"+qu+" value="+qu+" "+qu+"
| name="+qu+"select_button"+qu+"
|
onClick="+qu+"window.top.frames['I1'].location.href='contactos_1001form.asp?cmd=Fromlist&autonumber="+CStr(Rs("autonumber"))+"'"+qu+"></td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
| name="+qu+"db_firstname"+qu+" value="+qu+FillEmpty(rs("firstname"))+qu+"
| size="+qu+"8"+qu+">"
| Response.write "</td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
| name="+qu+"db_lastname"+qu+" value="+qu+FillEmpty(rs("lastname"))+qu+"
| size="+qu+"17"+qu+">"
| Response.write "</td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
| name="+qu+"db_telephone"+qu+" value="+qu+FillEmpty(rs("telephone"))+qu+"
| size="+qu+"15"+qu+">"
| Response.write "</td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
| name="+qu+"db_mobilephone"+qu+" value="+qu+FillEmpty(rs("mobilephone"))+qu+"
| size="+qu+"15"+qu+">"
| Response.write "</td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
| name="+qu+"db_sendbrochure"+qu+"
| value="+qu+FillEmpty(rs("sendbrochure"))+qu+" size="+qu+"2"+qu+">"
| Response.write "</td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
| name="+qu+"db_sendpostvisit"+qu+"
| value="+qu+FillEmpty(rs("sendpostvisit"))+qu+" size="+qu+"2"+qu+">"
| Response.write "</td>"
| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
| name="+qu+"db_information"+qu+" value="+qu+FillEmpty(rs("information"))+qu+"
| size="+qu+"18"+qu+">"
| Response.write "</td>"
| Response.write "</td><td>"
| Response.write "</td>"
| Response.write "</form>"
| Response.write "</tr>"+Crlf
| countrecs=countrecs+1
| Rs.movenext
| Wend
| End if
| If (Request.Querystring("cmd")="Find") Then
| rs.Close
| Set rs = Nothing
| conntemp.Close
| Set conntemp = Nothing
| End if
| %>
| </table>
|
| <%
| If (Request.Querystring("cmd")="Find") Then%>
| <center>
| <div align="center">
| <%=IntervalBox(curpage, Interval, NoOfRecs, "contactos_web.asp",
| request.querystring, "#000000", "2")%>
| </center>
| </div>
| <%End If
| %>
| </td><td height="45"></td>
| </tr>
| <tr>
| <td></td>
| <td> </td>
| <td height="239"></td>
| </tr>
| <tr>
| <td valign="top" align="middle" width="4"></td><td width="552"></td>
| <td height="80" width="0"></td>
| </tr>
| </table>
| <script language="JavaScript">
| <!--
| function Checkform(thisform) {
| // Init val
| strError = 'ATAF Version 6.1.0, Database : contactos_web\n\nYou have to
| correct the following error(s)\nbefore you can start your search.\n\n';
| intError = 0;
| if (intError == 1) {
| alert (strError)
| return false;
| }
| }
| // -->
| </script>
| <%
| If Err <> 0 Then
| pad="Sql Script Errors Occured!\n"
| pad = pad + "Error Number= #" & Err.Number & "\n"
| pad = pad + "Error Desc.= " & Err.Description &"\n\n"
| pad = pad + "Data not saved !!!\n"
| pad=Replace(pad,"'","´")
| response.write "<script language="+qu+"JavaScript"+qu+">"+CrLf
| response.write "<!--"+CrLf
| response.write "strError = '"+pad+"';"+Crlf
| response.write "alert (strError);"+CrLf
| response.write "// -->"+CrLf
| response.write "</script>"+CrLf
| End If
|
| If Session("Err") <> 0 Then
| pad="Sql Script Errors Occured!\n"
| pad=pad + "Error Number= #<b>" & Session("Err") & "\n"
| pad=pad + "Error Desc.= <b>" & Session("Description") &"\n\n"
| pad = pad + "Data not saved !!!\n"
| pad=Replace(pad,"'","´")
| response.write "<script language="+qu+"JavaScript"+qu+">"+CrLf
| response.write "<!--"+CrLf
| response.write "strError = '"+pad+"';"+Crlf
| response.write "alert (strError);"+CrLf
| response.write "// -->"+CrLf
| response.write "</script>"+CrLf
| Session("Err")=0
| End If
| %>
|
| </body>
| </html>
|
|
|
|
| "Stefan B Rusynko" wrote:
|
| > You are using the following general syntax for your buttons
| > (broken up by the button tag parameters)
| >
| > <input
| > type="button"
| > value="text"
| > onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=First&autonumber=X' "
| > <%=ShowTextOnPic("Some text here")%>
| > Class="formpagebutton">
| >
| > It appears your client side code is properly delimited
| > (with appropriate single and/or double quotes where needed)
| >
| > The server side Function <%=ShowTextOnPic("Some text here")%> must evaluate correctly server side
| > - as a valid client side attribute of the input tag
| >
| > Without seeing the ASP server side Function in your page ShowTextOnPic()
| > - it is hard to debug your server side code
| > - but it needs to write (server side) a valid form tag attribute
| > (like say: title="Some text here")
| >
| > Test your Function first (on a ASP page w/ just the function returns) with your string variables to verify it is working
| > <%
| > pictext1 = ShowTextOnPic("Chasquido para ir al primer registro")
| > Response .write pictext1
| > '...etc
| > %>
| >
| > PS
| > You could also do all your server side code evaluation of the functions using the same technique
| > <%
| > pictext1 = ShowTextOnPic("Chasquido para ir al primer registro")
| > %>
| > And in your buttons as say:
| > <input type="button" value="text" onClick="... " <%=pictext1%> Class="formpagebutton">
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > _____________________________________________
| >
| >
| > "Amateur" wrote in message news:42E06C15-18AF-477D-88E5-F139E2AE7F4C@microsoft.com...
| > | Dear Sirs,
| > | If I preview my ASP page I receive an error "unterminated string error" for
| > | most of the follwing code lines:
| > |
| > | <tr><td align="center" colspan="3">
| > | <p>
| > | <% If cmd<>"New" And cmd<>"Copy" Then %>
| > | <input type="button" value="æ<"
| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=First&autonumber=<%=Session("autonumber")%>'"
| > | <%=ShowTextOnPic("Chasquido para ir al primer registro")%>
| > | Class="formpagebutton">
| > | <input type="button" value="<<"
| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Prev&autonumber=<%=Session("autonumber")%>'"
| > | <%=ShowTextOnPic("Mueva un registro hacia atrás")%> Class="formpagebutton">
| > | <input type="text" size="8" Value="<%=Session("CurRec")%> de
| > | <%=Session("NumOfRecs")%>" Class="formpagebutton">
| > | <input type="button" value=">>"
| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Next&autonumber=<%=Session("autonumber")%>'"
| > | <%=ShowTextOnPic("Chasquido para ir para registrar después")%>
| > | Class="formpagebutton">
| > | <input type="button" value=">æ"
| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Last&autonumber=<%=Session("autonumber")%>'"
| > | <%=ShowTextOnPic("Chasquido para ir al último registro")%>
| > | Class="formpagebutton">
| > | <p>
| > |
| > | <input type="submit" value="Ahorrar" <%=ShowTextOnPic("Chasquido aquÃÂ para
| > | salvar sus cambios")%> Class="formpagebutton">
| > | <input type="button" value="Borrar"
| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Del&autonumber=<%=Session("autonumber")%>'"
| > | <%=ShowTextOnPic("Chasquido para borrar el registro corriente")%>
| > | Class="formpagebutton">
| > | <input type="button" value="Nuevo"
| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=New&autonumber=<%=Session("autonumber")%>'"
| > | <%=ShowTextOnPic("Chasquido para crear un nuevo registro")%>
| > | Class="formpagebutton" style="float: right">
| > | <input type="button" value="Print"
| > | onClick="parent.location='contactos_list.asp?cmd=Fromlist&autonumber=<%=CStr(Session("autonumber"))%>'"
| > | <%=ShowTextOnPic("Click here to print the current record")%>
| > | Class="formpagebutton"><input type="hidden" name="autonumber"
| > | value="<%=session("autonumber")%>">
| > | <input type="Hidden"name="cmd" value="Save">
| > | <% Else %>
| > | <input type="submit" value="Ahorrar" <%=ShowTextOnPic("Chasquido para salvar
| > | el nuevo registro")%> Class="formpagebutton">
| > | <input type="button" value="Anular"
| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp'"
| > | <%=ShowTextOnPic("Chasquido para anular creación de un nuevo registro")%>
| > | Class="formpagebutton">
| > | <input type="hidden" name="cmd" value="SaveNew">
| > | <%End If %>
| > | </td></tr>
| > |
| > | Can someone tell me what that means and how to debug that?
| > |
| > | Thanks
| > | Klaus
| >
| >
| >
date: Sat, 20 Sep 2008 04:17:50 -0400
author: Stefan B Rusynko
Re: Debugging
PS
Specifically Contact ATAF for support with their code at
http://www.ccr.dk/design/default.asp
(since your application was generated from their application /code generator)
--
_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________
"Stefan B Rusynko" wrote in message news:O9jaflvGJHA.2156@TK2MSFTNGP05.phx.gbl...
| None of the code provided includes the code for the Function you created called ShowTextOnPic
| - it is probably in the include file globalsub.asp
| Find the Function there and post the code
|
| As for all you other code it is to extensive for debugging in any newsgroup
| Since you say you are relatively new to ASP
| - it looks like the code you posted was created by someone else or some downloaded template
| (suggest you restart with the unmodified code and test after every change you make to see where the error was introduced)
| For more help see http://www.w3schools.com/asp/default.asp
|
| --
|
| _____________________________________________
| SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| "Warning - Using the F1 Key will not break anything!" (-;
| _____________________________________________
|
|
| "Amateur" wrote in message news:6EF77841-02B6-420A-85C0-5201F2485AC7@microsoft.com...
|| Hello Stefan
||
|| did read your suggestions, for which I'm very thankful. I tried what you
|| said - actually I'm relatively new to this and (to be honest) did not really
|| understand what I'm doing - and still dont understand in detail what you ment.
|| Just for security I send to you the complete code with the hope that you can
|| point me with some easier to understand words in the right direction.
||
|| CODE:
||
|| <!--#include File ="globalsub.asp"-->
|| <%
||
|| If Request.QueryString("dbcmd")="new" then
|| response.redirect "contactos_web.asp?cmd=New"
|| End if
|| If Request.QueryString("dbcmd")="delete" then
|| Set conntemp = server.CreateObject("adodb.Connection")
|| conntemp.open
|| "DSN=access;Database=f:\www.bellfield-barna.com\salespersonal\websales.mdb"
|| SqlStr = "DELETE FROM contactos_1001 WHERE autonumber="+
|| Request.QueryString("db_autonumber")
|| conntemp.Execute (SqlStr)
|| conntemp.Close
|| SqlStr=""
|| End if
||
|| If Request.QueryString("dbcmd")="save" then
|| Set conntemp = server.CreateObject("adodb.Connection")
|| conntemp.open
|| "DSN=access;Database=f:\www.bellfield-barna.com\salespersonal\websales.mdb"
|| SqlStr = "UPDATE contactos_1001 SET "
||
|| Sqlstr=SqlStr+"firstname='"+FixDbFieldSave(Request.QueryString("db_firstname")) + "', "
||
|| Sqlstr=SqlStr+"lastname='"+FixDbFieldSave(Request.QueryString("db_lastname"))
|| + "', "
||
|| Sqlstr=SqlStr+"telephone='"+FixDbFieldSave(Request.QueryString("db_telephone")) + "', "
||
|| Sqlstr=SqlStr+"mobilephone='"+FixDbFieldSave(Request.QueryString("db_mobilephone")) + "', "
|| Sqlstr=SqlStr+"sendbrochure="+Request.QueryString("db_sendbrochure") + ", "
|| Sqlstr=SqlStr+"sendpostvisit="+Request.QueryString("db_sendpostvisit") +
|| ", "
||
|| Sqlstr=SqlStr+"information='"+FixDbFieldSave(Request.QueryString("db_information")) + "', "
|| SqlStr = Mid(SqlStr, 1, Len(SqlStr) - 2)
|| SqlStr = SqlStr + " WHERE autonumber="+
|| Request.QueryString("db_autonumber")+ " "
|| If Instr(sqlstr," SE ")<=0 Then
|| conntemp.Execute (SqlStr)
|| End if
|| conntemp.close
|| SqlStr=""
|| End if
|| gui = request.querystring("gui")
|| curpage = request.querystring("Curpage")
|| If Curpage = "" Then Curpage = 1
|| Interval = request.querystring("Interval")
|| If Interval = "" Then Interval = 5
|| prefix=trim(Request.querystring("prefix"))
|| If prefix = "" then
|| prefix = "*"
|| End if
|| prefix_Operator=trim(Request.querystring("prefix_Operator"))
|| If prefix_Operator = "" then
|| prefix_Operator = "OR"
|| End if
|| If prefix_Operator = "OR" then
|| prefix_Operator_ORvar=" checked"
|| prefix_Operator_ANDvar=""
|| Else
|| prefix_Operator_ORvar=""
|| prefix_Operator_ANDvar=" checked"
|| End if
|| If (prefix<>"") And (prefix <> "*") then
|| SqlStr = SqlStr+"prefix LIKE '%"+prefix+"%' " + prefix_Operator + " "
|| End if
|| If SqlStr <> "" Then
|| SqlStrCount = "SELECT Count(autonumber) As NoOfRecs FROM contactos_1001
|| Where "+ SqlStr
|| SqlStrCount = Mid(SqlStrCount,1,len(SqlStrCount)-4)
|| Else
|| SqlStrCount = "SELECT Count(autonumber) As NoOfRecs FROM contactos_1001"
|| End if
|| If SqlStr <> "" Then
|| SqlStr ="SELECT * FROM contactos_1001 WHERE "+ SqlStr
|| SqlStr = Mid(SqlStr,1,len(SqlStr)-4)
|| Else
|| Sqlstr ="SELECT * FROM contactos_1001"
|| End if
|| SqlStr = SqlStr + " ORDER BY autonumber"
|| %>
|| <html>
|| <head>
|| <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|| <meta name="GENERATOR" content="ATAF Version 6.1.0">
|| <title>Contactosweb</title>
|| <base target="_self">
|| <link rel="stylesheet" type="text/css" href="globalcss.css">
||
|| <script Language="JavaScript">
|| function winopenexcel (sqlstr)
|| {
||
|
msg=open("","NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=150");
|| msg.location = "toexcel.asp?sqlstr="+sqlstr;
|| msg.focus()
|| }
|| </script>
||
|| </head>
|| <body class="formpage" topmargin="0" leftmargin="0" rightmargin="0"
|| bottommargin="0" marginwidth="0" marginheight="0" style="background-color:
|| #DFDFDF">
|| <table width="556" border="0" height="399">
|| <tr>
|| <td></tr>
|| <td></tr>
|| <td height="2"></td>
|| </tr>
|| <tr>
|| <td></td>
|| <td align="left"><img border="0" src="../../../BIE/images/c1_top.GIF"
|| width="556" height="17"></td>
|| <td height="21"></td>
|| </tr>
|| <tr>
|| <td></td>
|| <td valign="Default" >
|| <form method="GET" action="contactos_web.asp" name="contactos_1001"
|| onSubmit="return Checkform(this);">
||
|| <table border="0" cellpadding="0" cellspacing="0" class="formpagetable"
|| width="556" style="border-width: 0">
|| <tr>
|| <td colspan="2">
|| <table width="552" border="0">
||
|| </table>
|| <tr><td colspan="2" align="centre" class="listpagetablelabel" height="19">
|| <p align="center">
|| <input type="submit" value="Lista" Class="listpagebutton"
|| <%=ShowTextOnPic("Chasquido aquà para poner sus archivos en una lista")%>>
|| Ver<%=CreateDropDownBox(Cstr(interval), "5;10", "interval", "1",
|| "class='listpagetablelabel'", Cstr(interval))%> Archivos por página
|| </td>
|| </tr>
||
|| <p align="left"></td></tr>
|| <input type="hidden" name="cmd" value="Find">
|| </table>
|| </form>
|| <table border="0" cellpadding="0" cellspacing="0">
|| <%
|| If (Request.Querystring("cmd")="Find") Then
|| Set conntemp = server.CreateObject("adodb.Connection")
|| conntemp.open
|| "DSN=access;Database=f:\www.bellfield-barna.com\salespersonal\websales.mdb"
|| Set rs = conntemp.Execute(SqlStrCount)
|| NoOfRecs = rs("NoOfRecs")
|| Set rs = conntemp.Execute(SqlStr)
|| If rs.EOF <> True Then
|| End If
|| If CInt(curpage) > 1 Then
|| MoveForward = CInt(Interval) * (CInt(curpage) - 1)
|| For xx = 1 To MoveForward
|| If rs.EOF <> True Then
|| rs.MoveNext
|| End If
|| Next
|| End If
|| End if
|| If (Request.Querystring("cmd")="Find") Then
|| If (rs.EOF<>True) Then
|| Response.write " <tr class='listpageresultheader'>"
|| Response.write "<td></td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
|| class="+qu+"listsave"+qu+">"
|| Response.write "Nombre"
|| Response.write " </td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
|| class="+qu+"listsave"+qu+">"
|| Response.write "Apellido"
|| Response.write " </td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
|| class="+qu+"listsave"+qu+">"
|| Response.write "Teléfono"
|| Response.write " </td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
|| class="+qu+"listsave"+qu+">"
|| Response.write "Movil"
|| Response.write " </td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
|| class="+qu+"listsave"+qu+">"
|| Response.write "Bro."
|| Response.write " </td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
|| class="+qu+"listsave"+qu+">"
|| Response.write "Carta"
|| Response.write " </td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+"
|| class="+qu+"listsave"+qu+">"
|| Response.write "Informaciön"
|| Response.write " </td>"
|| Response.write "<td></td>"
|| Response.write "</tr>"
|| End if
|| End if
|| countrecs=0
|| If (Request.Querystring("cmd")="Find") Then
|| If (rs.EOF=True) Then
|| Response.write "¡Lamentable!, ningunos archivos encontrados"
|| End if
|| End if
|| If (Request.Querystring("cmd")="Find") Then
|| While (rs.EOF <> True) And (Request.Querystring("cmd")="Find") AND
|| (countrecs<CInt(Interval))
|| If lastWas = True Then
|| Varclass = "listpageresultline"
|| lastWas = False
|| Else
|| Varclass = "listpageresultlinealt"
|| lastWas = True
|| End If
|| Response.write "<form method="+qu+"GET"+qu+"
|| name="+qu+"db"+CStr(Rs("autonumber"))+qu+" target="+qu+"_self"+qu+">"
|| Response.write "<input type="+qu+"hidden"+qu+"
|| name="+qu+"db_autonumber"+qu+" value="+qu+CStr(Rs("autonumber"))+qu+">"
|| Response.write "<input type="+qu+"hidden"+qu+" name="+qu+"dbcmd"+qu+"
|| value="+qu+"save"+qu+">"
|| For Each Item In request.querystring
|| If (Item <> "dbcmd") And (Mid(item,1,3)<>"db_") Then
|| Response.Write "<input type="+qu+"hidden"+qu+" name="+qu+item+qu+"
|| value="+qu+request.querystring(Item)+qu+">"
|| End If
|| Next
|| Response.write "<tr title="+qu+"Chasquido aquà para corregir registro"+qu+"
|| class="+qu+varclass+qu+"
|| onClick="+qu+"db"+CStr(Rs("autonumber"))+".select_button.className
|| ='listbutselect';"+qu+"
|| onMouseout="+qu+"db"+CStr(Rs("autonumber"))+".select_button.className
|| ='listbutnotselect';"+qu+">"
|| Response.write "<td><input type="+qu+"button"+qu+" value="+qu+" "+qu+"
|| name="+qu+"select_button"+qu+"
||
|
onClick="+qu+"window.top.frames['I1'].location.href='contactos_1001form.asp?cmd=Fromlist&autonumber="+CStr(Rs("autonumber"))+"'"+qu+"></td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
|| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
|| name="+qu+"db_firstname"+qu+" value="+qu+FillEmpty(rs("firstname"))+qu+"
|| size="+qu+"8"+qu+">"
|| Response.write "</td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
|| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
|| name="+qu+"db_lastname"+qu+" value="+qu+FillEmpty(rs("lastname"))+qu+"
|| size="+qu+"17"+qu+">"
|| Response.write "</td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
|| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
|| name="+qu+"db_telephone"+qu+" value="+qu+FillEmpty(rs("telephone"))+qu+"
|| size="+qu+"15"+qu+">"
|| Response.write "</td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
|| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
|| name="+qu+"db_mobilephone"+qu+" value="+qu+FillEmpty(rs("mobilephone"))+qu+"
|| size="+qu+"15"+qu+">"
|| Response.write "</td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
|| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
|| name="+qu+"db_sendbrochure"+qu+"
|| value="+qu+FillEmpty(rs("sendbrochure"))+qu+" size="+qu+"2"+qu+">"
|| Response.write "</td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
|| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
|| name="+qu+"db_sendpostvisit"+qu+"
|| value="+qu+FillEmpty(rs("sendpostvisit"))+qu+" size="+qu+"2"+qu+">"
|| Response.write "</td>"
|| Response.write "<td align="+qu+"left"+qu+" valign="+qu+"top"+qu+">"
|| Response.write "<input class="+qu+varclass+qu+" type="+qu+"text"+qu+"
|| name="+qu+"db_information"+qu+" value="+qu+FillEmpty(rs("information"))+qu+"
|| size="+qu+"18"+qu+">"
|| Response.write "</td>"
|| Response.write "</td><td>"
|| Response.write "</td>"
|| Response.write "</form>"
|| Response.write "</tr>"+Crlf
|| countrecs=countrecs+1
|| Rs.movenext
|| Wend
|| End if
|| If (Request.Querystring("cmd")="Find") Then
|| rs.Close
|| Set rs = Nothing
|| conntemp.Close
|| Set conntemp = Nothing
|| End if
|| %>
|| </table>
||
|| <%
|| If (Request.Querystring("cmd")="Find") Then%>
|| <center>
|| <div align="center">
|| <%=IntervalBox(curpage, Interval, NoOfRecs, "contactos_web.asp",
|| request.querystring, "#000000", "2")%>
|| </center>
|| </div>
|| <%End If
|| %>
|| </td><td height="45"></td>
|| </tr>
|| <tr>
|| <td></td>
|| <td> </td>
|| <td height="239"></td>
|| </tr>
|| <tr>
|| <td valign="top" align="middle" width="4"></td><td width="552"></td>
|| <td height="80" width="0"></td>
|| </tr>
|| </table>
|| <script language="JavaScript">
|| <!--
|| function Checkform(thisform) {
|| // Init val
|| strError = 'ATAF Version 6.1.0, Database : contactos_web\n\nYou have to
|| correct the following error(s)\nbefore you can start your search.\n\n';
|| intError = 0;
|| if (intError == 1) {
|| alert (strError)
|| return false;
|| }
|| }
|| // -->
|| </script>
|| <%
|| If Err <> 0 Then
|| pad="Sql Script Errors Occured!\n"
|| pad = pad + "Error Number= #" & Err.Number & "\n"
|| pad = pad + "Error Desc.= " & Err.Description &"\n\n"
|| pad = pad + "Data not saved !!!\n"
|| pad=Replace(pad,"'","´")
|| response.write "<script language="+qu+"JavaScript"+qu+">"+CrLf
|| response.write "<!--"+CrLf
|| response.write "strError = '"+pad+"';"+Crlf
|| response.write "alert (strError);"+CrLf
|| response.write "// -->"+CrLf
|| response.write "</script>"+CrLf
|| End If
||
|| If Session("Err") <> 0 Then
|| pad="Sql Script Errors Occured!\n"
|| pad=pad + "Error Number= #<b>" & Session("Err") & "\n"
|| pad=pad + "Error Desc.= <b>" & Session("Description") &"\n\n"
|| pad = pad + "Data not saved !!!\n"
|| pad=Replace(pad,"'","´")
|| response.write "<script language="+qu+"JavaScript"+qu+">"+CrLf
|| response.write "<!--"+CrLf
|| response.write "strError = '"+pad+"';"+Crlf
|| response.write "alert (strError);"+CrLf
|| response.write "// -->"+CrLf
|| response.write "</script>"+CrLf
|| Session("Err")=0
|| End If
|| %>
||
|| </body>
|| </html>
||
||
||
||
|| "Stefan B Rusynko" wrote:
||
|| > You are using the following general syntax for your buttons
|| > (broken up by the button tag parameters)
|| >
|| > <input
|| > type="button"
|| > value="text"
|| > onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=First&autonumber=X' "
|| > <%=ShowTextOnPic("Some text here")%>
|| > Class="formpagebutton">
|| >
|| > It appears your client side code is properly delimited
|| > (with appropriate single and/or double quotes where needed)
|| >
|| > The server side Function <%=ShowTextOnPic("Some text here")%> must evaluate correctly server side
|| > - as a valid client side attribute of the input tag
|| >
|| > Without seeing the ASP server side Function in your page ShowTextOnPic()
|| > - it is hard to debug your server side code
|| > - but it needs to write (server side) a valid form tag attribute
|| > (like say: title="Some text here")
|| >
|| > Test your Function first (on a ASP page w/ just the function returns) with your string variables to verify it is working
|| > <%
|| > pictext1 = ShowTextOnPic("Chasquido para ir al primer registro")
|| > Response .write pictext1
|| > '...etc
|| > %>
|| >
|| > PS
|| > You could also do all your server side code evaluation of the functions using the same technique
|| > <%
|| > pictext1 = ShowTextOnPic("Chasquido para ir al primer registro")
|| > %>
|| > And in your buttons as say:
|| > <input type="button" value="text" onClick="... " <%=pictext1%> Class="formpagebutton">
|| >
|| > --
|| >
|| > _____________________________________________
|| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
|| > "Warning - Using the F1 Key will not break anything!" (-;
|| > _____________________________________________
|| >
|| >
|| > "Amateur" wrote in message news:42E06C15-18AF-477D-88E5-F139E2AE7F4C@microsoft.com...
|| > | Dear Sirs,
|| > | If I preview my ASP page I receive an error "unterminated string error" for
|| > | most of the follwing code lines:
|| > |
|| > | <tr><td align="center" colspan="3">
|| > | <p>
|| > | <% If cmd<>"New" And cmd<>"Copy" Then %>
|| > | <input type="button" value="æ<"
|| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=First&autonumber=<%=Session("autonumber")%>'"
|| > | <%=ShowTextOnPic("Chasquido para ir al primer registro")%>
|| > | Class="formpagebutton">
|| > | <input type="button" value="<<"
|| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Prev&autonumber=<%=Session("autonumber")%>'"
|| > | <%=ShowTextOnPic("Mueva un registro hacia atrás")%> Class="formpagebutton">
|| > | <input type="text" size="8" Value="<%=Session("CurRec")%> de
|| > | <%=Session("NumOfRecs")%>" Class="formpagebutton">
|| > | <input type="button" value=">>"
|| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Next&autonumber=<%=Session("autonumber")%>'"
|| > | <%=ShowTextOnPic("Chasquido para ir para registrar después")%>
|| > | Class="formpagebutton">
|| > | <input type="button" value=">æ"
|| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Last&autonumber=<%=Session("autonumber")%>'"
|| > | <%=ShowTextOnPic("Chasquido para ir al último registro")%>
|| > | Class="formpagebutton">
|| > | <p>
|| > |
|| > | <input type="submit" value="Ahorrar" <%=ShowTextOnPic("Chasquido aquÃÂ para
|| > | salvar sus cambios")%> Class="formpagebutton">
|| > | <input type="button" value="Borrar"
|| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=Del&autonumber=<%=Session("autonumber")%>'"
|| > | <%=ShowTextOnPic("Chasquido para borrar el registro corriente")%>
|| > | Class="formpagebutton">
|| > | <input type="button" value="Nuevo"
|| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp?cmd=New&autonumber=<%=Session("autonumber")%>'"
|| > | <%=ShowTextOnPic("Chasquido para crear un nuevo registro")%>
|| > | Class="formpagebutton" style="float: right">
|| > | <input type="button" value="Print"
|| > | onClick="parent.location='contactos_list.asp?cmd=Fromlist&autonumber=<%=CStr(Session("autonumber"))%>'"
|| > | <%=ShowTextOnPic("Click here to print the current record")%>
|| > | Class="formpagebutton"><input type="hidden" name="autonumber"
|| > | value="<%=session("autonumber")%>">
|| > | <input type="Hidden"name="cmd" value="Save">
|| > | <% Else %>
|| > | <input type="submit" value="Ahorrar" <%=ShowTextOnPic("Chasquido para salvar
|| > | el nuevo registro")%> Class="formpagebutton">
|| > | <input type="button" value="Anular"
|| > | onClick="javascript:top.frames['I1'].location='contactos_1001form.asp'"
|| > | <%=ShowTextOnPic("Chasquido para anular creación de un nuevo registro")%>
|| > | Class="formpagebutton">
|| > | <input type="hidden" name="cmd" value="SaveNew">
|| > | <%End If %>
|| > | </td></tr>
|| > |
|| > | Can someone tell me what that means and how to debug that?
|| > |
|| > | Thanks
|| > | Klaus
|| >
|| >
|| >
|
|
date: Sat, 20 Sep 2008 05:04:54 -0400
author: Stefan B Rusynko
|
|