Hi all,
Here is my code :-
Code:
<%
Dim oADO, oRS, sSQL
Dim sUserID, sPassword
sStd_ID = Request.Form("txtStd_ID")
sStd_pwd = Request.Form("txtStd_pwd")
sSQL = "SELECT Quizes,Midterm1,Midterm2,Final,Bonus,Grade FROM [sheet1$]
WHERE [Std_ID]='" & q(sStd_ID) & "' AND [Std_pwd]='" & q(sStd_pwd) & "'"
Set oADO = CreateObject("ADODB.Connection")
oADO.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\Path\To\This\File.xls;Extended Properties=""Excel
8.0;HDR=Yes;IMEX=1"""
Set oRS = oADO.Execute(sSQL)
If oRS.EOF Then
Response.Write "Login failed."
Else
%>
<table>
<tr>
<th>quizzes</th>
<th>Midterm 1</th>
<th>Midterm 2</th>
<th>final</th>
<th>bonus</th>
<th>grade</th>
</tr>
<tr>
<td><%=oRS.Fields.Item(0).Value%></td>
<td><%=oRS.Fields.Item(1).Value%></td>
<td><%=oRS.Fields.Item(2).Value%></td>
<td><%=oRS.Fields.Item(3).Value%></td>
<td><%=oRS.Fields.Item(4).Value%></td>
<td><%=oRS.Fields.Item(5).Value%></td>
</tr>
</table>
<%
End If
oRS.Close : Set oRS = Nothing
oADO.Close : Set oADO = Nothing
Function q(s)
q = Replace(s, "'", "''")
End Function
%>
As you can see its linked to Excel sheet and when I try to execute the code it gives me this error :-
Technical Information (for support personnel)
Error Type:
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
/results.asp, line 16
Line 16 is :-
Set oRS = oADO.Execute(sSQL)
what do you think the problem is ?
