By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,077 Members | 2,160 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,077 IT Pros & Developers. It's quick & easy.

data type mismatch error

P: n/a
I am getting the following error while converting an asp application
to asp.net

Exception Details: System.Runtime.InteropServices.COMException: Data
type mismatch in criteria expression.

Source Error:

Line 233:
Line 234: rs =
Server.CreateObject("ADODB.recordset")
Line 235: rs.open(" Select * From tblEvent WHERE
date_of_event = '" & currenttime & " ' ", conn, 1, 3)
Line 236: 'response.Write(sql1)
Line 237:
Source File: C:\Documents and Settings\amit\WebSite1\calendar.aspx
Line: 235

Stack Trace:

[COMException (0x80040e07): Data type mismatch in criteria expression.]

Microsoft.VisualBasic.CompilerServices.LateBinding .InternalLateCall(Object
o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack, Boolean IgnoreReturn) +776

Microsoft.VisualBasic.CompilerServices.NewLateBind ing.LateCall(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean
IgnoreReturn) +193987
ASP.calendar_aspx.__Render__control1(HtmlTextWrite r __w, Control
parameterContainer) in C:\Documents and
Settings\amit\WebSite1\calendar.aspx:235
System.Web.UI.Control.RenderChildrenInternal(HtmlT extWriter writer,
ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +27
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter writer,
ControlAdapter adapter) +53
System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
ControlAdapter adapter) +280
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+8878

Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
My guess is that (a) either your date in an incorrect format, or (b) you
should place it between # instead of '
(http://support.microsoft.com/default.aspx/kb/175258)

It's good that you are going the ASP.Net route, but why use a RecordSet when
you could be using a DAtaReader?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
<am*******@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I am getting the following error while converting an asp application
to asp.net

Exception Details: System.Runtime.InteropServices.COMException: Data
type mismatch in criteria expression.

Source Error:

Line 233:
Line 234: rs =
Server.CreateObject("ADODB.recordset")
Line 235: rs.open(" Select * From tblEvent WHERE
date_of_event = '" & currenttime & " ' ", conn, 1, 3)
Line 236: 'response.Write(sql1)
Line 237:
Source File: C:\Documents and Settings\amit\WebSite1\calendar.aspx
Line: 235

Stack Trace:

[COMException (0x80040e07): Data type mismatch in criteria expression.]

Microsoft.VisualBasic.CompilerServices.LateBinding .InternalLateCall(Object
o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack, Boolean IgnoreReturn) +776

Microsoft.VisualBasic.CompilerServices.NewLateBind ing.LateCall(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean
IgnoreReturn) +193987
ASP.calendar_aspx.__Render__control1(HtmlTextWrite r __w, Control
parameterContainer) in C:\Documents and
Settings\amit\WebSite1\calendar.aspx:235
System.Web.UI.Control.RenderChildrenInternal(HtmlT extWriter writer,
ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +27
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter writer,
ControlAdapter adapter) +53
System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
ControlAdapter adapter) +280
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+8878

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.