Error - 2147217913 80040e07
Data type mismatch in Criteria expression If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 6 of 6 Thread: [RESOLVED] runtime error -2147217913 - Data type mismatch in Criteria expression Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Apr 6th, 2007,12:14 PM #1 aikidokid View Profile View Forum Posts Thread Starter Frenzied Member Join Date Aug 2002 Location Bristol, UK Posts 1,968 [RESOLVED] runtime error -2147217913 - Data type mismatch in Criteria expression I am getting the error mentioned above on this code. It stops on the rs.open line (2nd Time used) I have looked on google and found an answer about putting the strings in [], but this didn't seem to make any difference. vb Code: Dim cn As New ADODB.ConnectionDim rs As New ADODB.RecordsetDim strSQL As StringDim ID As Long 'holds the NodeID value to search the tbl_Codecn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source =" & App.Path & "\CLDB.mdb"cn.OpenSet rs = New ADODB.RecordsetstrSQL = "SELECT Node_ID, NodeName FROM tbl_Nodes"strSQL = strSQL & " WHERE NodeName = '" & CategoryToLoad & "'"rs.Open strSQL, cn, adOpenKeyset, adLockPessimistic, adCmdTextID = rs!Node_ID.Valuers.CloseSet rs = New ADODB.RecordsetstrSQL = "SELECT NodeID, Code_Description FROM tbl_Code"strSQL = strSQL & " WHERE NodeID = '" & ID & "'"rs.Open strSQL, cn, adOpenKeyset, adLockPessimistic, adCmdText <------HEREDo While Not rs.EOF frmSearch.lstSearch.AddItem rs!Code_Description.ValueLooprs.CloseSet rs = Nothingcn.Close Last edited by aikidokid; Apr 6th, 2007 at 12:17 PM. Reason: more detail added If somebody helps you, take time to RATE the post. I do. "FAILURE IS NOT AN OPTION. It comes bundled with the software." Below are some of the threads that have helped me along the way: CodeBank submission: Listview Backcolor (without subclassing) Loading Treeview Nodes From A Database, Creating Registry Keys, Count Number of Lines in TextBox , Excellent RichTextBox Tricks & Tips Ideas & Screen Shots For A Code Library App How to do Data validation in Excel, Conditional Formating in Excel Reply With Quote Apr 6th, 2007,12:21 PM #2 si_the_geek View Profile View Forum Posts Super Moderator Join Date Jul 2002 Location Bristol, UK Posts 38,295 Re: runtime error -2147217913 - Data type mismatch in Criteria expression Do not ever put strings inside [ ] , that is only for
Community Top Posters Today's Posts Search Community Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Page 1 of 2 1 2 > Thread Tools Rate Thread Display Modes 02-10-2009, 01:05 PM #1 jpindi Newly Registered User Join Date: Jan 2009 Posts: 22 Thanks: 0 Thanked 0 Times in 0 Posts Run-time error '-2147217913 (80040e07)': Data type mismatch in criteria expression. Hello I am http://www.vbforums.com/showthread.php?461948-RESOLVED-runtime-error-2147217913-Data-type-mismatch-in-Criteria-expression trying to create a VBA script which removes duplicates from a single table. It searches for duplicates based on two fields (IDtable1 and IDtable2) puts them in a string and then if the string is a duplicate to the one preceeding then it deletes that line. That part is ok, but there seems to be an overflow problem. The table is http://www.access-programmers.co.uk/forums/showthread.php?t=165586 'overflowing' on the ID (autonumber) of the table which should be straightforward enough. Debugging it highlights the line id1 = rstJunction("ID").Value. I've set id1 as an Integer which I thought would match up nicely, but notice the ID numbers are quite high (in excess of 79,000) and as a result there is an overflow error. I then tried setting id1 as either Long, Single or Double and the error that I get is the following: Run-time error '-2147217913 (80040e07)': Data type mismatch in criteria expression. The debugging highlight goes over the line cn1.Execute SQLd Perhaps something with my SQL command? Here is the code, minus the open recordset such-and-such: Dim strDuplicate1 As String Dim strDuplicate2 As String Dim id1 As Long Dim SQLd As String strDuplicate1 = "" strDuplicate2 = "" id1 = 0 If rstJunction.BOF And rstJunction.EOF Then MsgBox "No matches found" Else rstJunction.MoveFirst rstJunction.MoveNext id1 = rstJunction("ID").Value Do Until rstJunction.EOF strDuplicate1 = rstJunction("IDtable1").Value & rstJunction("IDtable2").Value If strDuplicate1 = strDuplicate2 Then SQLd = "DELETE FROM tblJunction WHERE ID = ('" & id1 & "')" cn1.Execute (SQLd) Else strDuplicate2 = rstJunctio
siehst YouTube auf Deutsch. Du kannst diese Einstellung unten ändern. Learn more You're viewing YouTube in German. You can change this preference below. Schließen Ja, https://www.youtube.com/watch?v=v7rbr6XyYcg ich möchte sie behalten Rückgängig machen Schließen Dieses Video ist nicht verfügbar. WiedergabelisteWarteschlangeWiedergabelisteWarteschlange Alle entfernenBeenden Wird geladen... Wiedergabeliste Warteschlange __count__/__total__ Run time error ' 2147217913 80040e07' nic niCols AbonnierenAbonniertAbo beenden3.9873 Tsd. Wird geladen... Wird geladen... Wird verarbeitet... Hinzufügen Möchtest du dieses Video später noch einmal ansehen? Wenn du bei YouTube angemeldet error - bist, kannst du dieses Video zu einer Playlist hinzufügen. Anmelden Teilen Mehr Melden Möchtest du dieses Video melden? Melde dich an, um unangemessene Inhalte zu melden. Anmelden Statistik 465 Aufrufe 9 Dieses Video gefällt dir? Melde dich bei YouTube an, damit dein Feedback gezählt wird. Anmelden 10 0 Dieses Video gefällt error - 2147217913 dir nicht? Melde dich bei YouTube an, damit dein Feedback gezählt wird. Anmelden 1 Wird geladen... Wird geladen... Wird geladen... Die Bewertungsfunktion ist nach Ausleihen des Videos verfügbar. Diese Funktion ist zurzeit nicht verfügbar. Bitte versuche es später erneut. Veröffentlicht am 30.04.2015Run-time error '-2147217913 (80040e07)'Преобразование типа данных varchar в тип datetime привело к выходу значения за пределы диапазона. Купи Energy Diet по этой ссылке http://nlstar.com/ref/p1b38s Kategorie Unterhaltung Lizenz Standard-YouTube-Lizenz Mehr anzeigen Weniger anzeigen Wird geladen... Autoplay Wenn Autoplay aktiviert ist, wird die Wiedergabe automatisch mit einem der aktuellen Videovorschläge fortgesetzt. Nächstes Video How to fix run-time error -2147467259 - Dauer: 3:19 usmanalitoo 17.829 Aufrufe 3:19 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified - Dauer: 1:44 64-bit Programmer 62.249 Aufrufe 1:44 autodata 3.38 sin error - Dauer: 3:46 2903 Tavarez 10.558 Aufrufe 3:46 VBA Run-time Error '91' Object-variable or With block variable not set -