msaccess のテーブルに Web リソースのデータを入力しました。msaccess のテーブルのメタデータと私のコードは
Dim Con1 As OleDbConnection = Nothing
Dim LastDateTimeOfRawNews As DateTime = Nothing
Private Function copyLatestNewstoNewsAndTemporary()
Con1 = DB_Manager.getConnection()
Con1.Open()
Dim SQL2 As String = ""
LastDateTimeOfRawNews = "#6/7/2013 4:36:46 PM#"
SQL2 = "insert into TemporaryNews(Title) SELECT Title FROM News where News.news_Date >='" + LastDateTimeOfRawNews + "'"
Dim objCmd2 As OleDbCommand = New OleDbCommand(SQL2, Con1)
objCmd2.ExecuteNonQuery()
Con1.Close()
End Function
メタデータ:
NewsId -> AutoNumber
Title -> Text
news_Date Date/Time etc
{"条件式のデータ型が一致しません。"} 例外が発生しました
exception full detail is as under
System.Data.OleDb.OleDbException was unhandled
ErrorCode=-2147217913
Message=Data type mismatch in criteria expression.
Source=Microsoft JET Database Engine
StackTrace:
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at WBand.frmMain.copyLatestNewstoNewsAndTemporary() in C:\Users\Khanz\Desktop\Latest news\Editing\WBand\Form1.vb:line 679
at WBand.frmMain.Button3_Click(Object sender, EventArgs e) in C:\Users\Khanz\Desktop\Latest news\Editing\WBand\Form1.vb:line 918
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at WBand.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
また、msaccess の datetime 型と vb.net の datetime 型に違いがあることを教えてください。