guarda l'allegato ecco cosa mi dice in access type mismatch
guarda l'allegato ecco cosa mi dice in access type mismatch
ciao ho fatto come mi hai detto ecco la query ma il problema e' che non gli arrivano i parametri ecco tutto il codice.....
<%@LANGUAGE = VbScript
%>
<%
'connection to database ("mdb/database")
dim conn
Set Conn=Server.CreateObject("ADODB.Connection")
strConn="driver={Microsoft Access Driver (*.mdb)}; "
strConn=strConn & " DBQ=" & Server.MapPath("mdb/database.mdb")
strConn=strConn & ";pwd=innovatel"
strConn= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("mdb/database.mdb")
conn.Open strConn
'this function find staff.name where Area.idArea = vid
function extractname(vid, title)
sql = "SELECT Area.IdArea, Level.Level, Staff.Name, Staff.Position, Staff.IdStaff " _
& " FROM [Level] INNER JOIN (Area INNER JOIN Staff ON Area.IdArea = Staff.AreaCode) ON Level.IdPosition = Staff.LevelCode " _
& " WHERE (((Area.IdArea)="&vid&")) " _
& "ORDER BY Level.Level;"
'queryarea select to every staff.name own area
sql = "SELECT * FROM QueryArea "_
& " WHERE (((IdArea)="&vid&")) " _
& "ORDER BY IdArea, Level.Level;"
' create recordset and start to write the table structure with dates
dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn ,3,3
'dim nome
'nome= request.QueryString("[Staff].[Name]")
'response.Write(nome)
'response.End()
'strSQL = "select COUNT(read) AS totaleRecord FROM MessageBoard"
'strSQL = "select * from querylucaread"
'strSQL = "SELECT MessageBoard.IdMessageBoard, MessageBoard.Mittente, MessageBoard.Read FROM MessageBoard WHERE ((MessageBoard.Mittente)="luca") AND ((MessageBoard.Read)=No));"
'strSQL = "select * from queryNoRead"
'strSQL = "SELECT Staff.Name FROM [Staff] WHERE (((IdArea)="&vid&"))"
strSQL = "SELECT MessageBoard.IdMessageBoard,MessageBoard.Destinata rio,MessageBoard.Read, Staff.Name" _
& "FROM [MessageBoard] INNER JOIN Staff ON MessageBoard.Destinatario = Staff.Name " _
& "WHERE MessageBoard.Read = 'No';"
response.Write(strSQL)
response.end
Set rs1 = Server.createObject("ADODB.Recordset")
rs1.Open strSQL, conn ,3,3
response.write "<table align='center' width='150' cellpadding='1' cellspacing='0' style='border: Solid 1px #000000;'>"
response.write"<tr bgcolor='#FF0000' border='1'>"
response.write"<td colspan='2'>"
response.write""
response.write title
response.write""
response.write "</td>"
response.write"</tr>"
response.write"<tr bgcolor='#CCCCCC' border='1'>"
response.write"<td width='60' align='left'>Name"
response.write"</td>"
response.write"<td width='90' align='left'>Position"
response.write"</td>"
response.write"<td>"
response.write"record"
response.write"</td>"
response.write"</tr>"
do while not(rs.eof)
response.write"<tr border='1'>"
response.write"<td>"
response.write"<a href = 'details.asp?idreq="&rs.fields("IdStaff")&"' target='right'>"'right
response.write rs.fields("name")
response.Write"</a>"
response.write"</td>"
response.write"<td>"
response.write rs.fields("position")
response.write"</td>"
response.write"<td>"
' Stampa il risultato
'Response.Write("Nel database sono presenti ")
' Ecco il risultato del conteggio
'Response.Write(objRs("totaleRecord"))
'Response.Write(" record in totale.")
Response.Write "" & rs1.RecordCount & ""
response.write"</td>"
response.write"</tr>"
rs.movenext
loop
response.write"</table>"
rs.close
set rs=nothing
rs1.Close
Set rs1 = Nothing
end function
'this function find position of every staff.name where Area.idArea = vid
function extractposition(vid)
sql = "SELECT Area.IdArea, Level.Level, Staff.Name, Staff.Position, Staff.IdStaff " _
& " FROM [QueryArea] INNER JOIN (Area INNER JOIN Staff ON Area.IdArea = Staff.AreaCode) ON Level.IdPosition = Staff.LevelCode " _
& " WHERE (((Area.IdArea)="&vid&")) " _
& "ORDER BY Area.IdArea, Level.Level;"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn ,3,3
do while not(rs.eof)
response.write rs.fields("position") &"
"
rs.movenext
loop
rs.close
set rs=nothing
end function
%>
<html>
<head>
<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Begin
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Sorry, Disability Right Click!");
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
// End -->
</script>
<script language="JavaScript1.2">
<!--hide
var isnMonth = new
Array("Genuary","Febbrary","March","April","May"," June","July","Agust","September","October","Novemb er","Dicember");
var isnDay = new
Array("Sunday","Monday","Tuesday","Wendsday","Thur sday","Friday","Saturday","Sunday");
today = new Date () ;
Year=today.getYear();
Date=today.getDate();
if (document.all)
document.title="Hi. Today \is: "+isnDay[today.getDay()]+", "+Date+" "+isnMonth[today.getMonth()]+" "+Year+""
//--hide-->
function apri(url) {
newin = window.open(url,'title','scrollbars=auto,resizable =yes, width=400,height=400,status=no,location=no,toolbar =no');
}
</script>
<title>Organization Chart</title>
<style type="text/css">
td, p, input, textarea { font-size: 10 px; font-family: Verdana; }
a { color: #000080; text-decoration: None; }
a:hover { color: #800000; text-decoration: Underline; }
.style1 {font-size: 8px}
.style2 {font-size: 10px; color:red}
</style>
</head>
<body>
<table width="779">
<tr>
<td colspan="2" rowspan="2" valign="top"><%extractname 1,"1 Director"
%></td>
<td height="22" colspan="5" valign="top">[img]images/barra.gif[/img]</td>
</tr>
<tr>
<td width="148" rowspan="1" valign="top"><%extractname 2,"2 Administration"
%> </td>
<td width="148" rowspan="2" valign="top"> <%extractname 3,"3 Sales"
%></td>
<td width="148" rowspan="3" valign="top"><%extractname 4,"4 Service"
%> </td>
<td width="148" rowspan="3" valign="top"><%extractname 5,"5 Customer Service"
%> </td>
<td width="1"></td>
</tr>
<%
conn.Close
set conn = Nothing
'connection to db is close now
%>
<%
dim conn1
Set Conn1=Server.CreateObject("ADODB.Connection")
strConn1="driver={Microsoft Access Driver (*.mdb)}; "
strConn1=strConn1 & " DBQ=" & Server.MapPath("mdb/database.mdb")
strConn1=strConn1 & ";pwd=innovatel"
strConn1= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("mdb/database.mdb")
conn1.Open strConn1
'querycompany select to Espresso Italia
sql = "SELECT *All From QueryCompany "
%>
<tr>
<td width="115" rowspan="1" valign="top">[img]images/espressologo100.gif[/img]</td>
<td width="27" height="19"></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="42"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="4"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="38"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
Qualche idea?
HELP ME PLEASE !!!!!!!!!!!![]()
MessageBoard.Read è un campo di tipo...?
tipo si o no, ma il problema e' che non riconosce l'uguglianza tra:MessageBoard.Destinatario = Staff.Name
due campi testo!
che ne dici?
tipo si/no è booleano. prova a mettere 0 (zero), senza apici, invece di 'No' nella where
provato no cambia niente.....
posta la query attuale
eccola....
strSQL = "SELECT MessageBoard.IdMessageBoard, MessageBoard.Destinatario, MessageBoard.Read FROM [MessageBoard] INNER JOIN Staff ON MessageBoard.Destinatario = Staff.Name WHERE MessageBoard.Read = 0"
a che serve la inner join con staff se poi non usi mai la tabella staff?
Tutti vogliono parlare, nessuno sa ascoltare.