2147217900 Syntax Error In
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have
Sql Server 2147217900
Meta Discuss the workings and policies of this site About Us run time error 2147217900 80040e14 Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with run-time error '-2147217900 (80040e14) us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Syntax error in INSERT INTO statement RTE '-2147217900 (80040e14)': up vote 2 down vote favorite I have tried paring the strSQL back to just one field and everything works. As soon as I add a second field I start getting the error. This tells me that references are correct. I've tried a lot of different spacing around the ()'s with no luck either. ?strSQL INSERT INTO tbl_buyer_column (ship_id, aels_id, buyer_wss, column, date_created)VALUES(23, 13, K, 1, #04/17/2015#) Public Sub fun_insert_into(lngship_id As Long, lngAels_id As Long, strBuyer_wss As String, lngColumn As Long, datDate_created As Date) Dim strSQL As String Dim adoCon As ADODB.Connection Dim adoCmd As ADODB.Command Set adoCon = CurrentProject.Connection Set adoCmd = New ADODB.Command strSQL = "INSERT INTO tbl_buyer_column (ship_id, aels_id, buyer_wss, column, date_created)" & _ "VALUES(" & lngship_id & ", " & lngAels_id & ", " & strBuyer_wss & ", " & lngColumn & ", " & SQLDate(datDate_created) & ")" With adoCmd .ActiveConnection = adoCon .CommandType = adCmdText .CommandText = strSQL .Execute End With adoCon.Close Set adoCon = Nothing Set adoCmd = Nothing End Sub ms-access access-vba ms-access-2010 share|improve this question edited Apr 17 '15 at 16:56 HansUp 79.1k114371 asked Apr 17 '15 at 16:44 Kaw4Life 9111 add a comment| 1 Answer 1 active oldest
statement + Ask a Question Need help? Post your question and get tips & solutions from a community of 418,416 IT Pros & Developers. It's quick & easy. Run-Time error -2147217900(80040e14) Syntax error in INSERT INTO statement P: 5 rahul more Hiiii I am making my project in VB6.0 and my back end is Access 2003. I hav one problem..... When I going to save data into database, at at cmdSave_Click event, VB giving me http://stackoverflow.com/questions/29704988/syntax-error-in-insert-into-statement-rte-2147217900-80040e14 error(Error mentioned at heading)after clicking on SAVE button and Highlighting the statement which are as follows..... rs.Open "Insert into addclasses (Batch, BatchTime, Std, CollYear, SchlBtchName, CollBtchName, BatchType, SchlSubjct ,CollSubjct, Teacher, Days, LecDate, StartTime, AM/PM1, EndTime, AM/PM2) values ("& cboBtch.Tag & ", " & cboBtchTime.Tag & ", " & cboStd.Tag & ", " & cboYear.Tag & ", " & https://bytes.com/topic/visual-basic/answers/909218-run-time-error-2147217900-80040e14-syntax-error-insert-into-statement cboBtchNoSchl.Tag & ", " & cboBtchNoColl & ", " & cboBtchType.Tag & ", " & cboTeacher.Tag & ", '" & txtDays.Text & "', #" & DTPicker1.Value & "#, '" & txtStrtTime.Text & "', " & cboTime1.Tag & ", '" & txtEndTime.Text & "', " & cboTime2 & ")", con, adOpenDynamic, adLockOptimistic Expand|Select|Wrap|Line Numbers (insideModule) OptionExplicit PublicconAsADODB.Connection PublicrsAsADODB.Recordset PublicFunctionconn() Setcon=NewADODB.Connection con.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;DataSource="&App.Path&"\CCMS.mdb;PersistSecurityInfo=False" con.Open"CCMS.mdb" EndFunction PublicFunctionreco() Setrs=NewADODB.Recordset EndFunction Expand|Select|Wrap|Line Numbers (inactualform'scodewindow) PrivateSubcmdSave_Click() Ifrs.State=1Thenrs.Close Callreco rs.Open"Insertintoaddclasses(Batch,BatchTime,Std,CollYear,SchlBtchName,CollBtchName,BatchType,SchlSubjct,CollSubjct,Teacher,Days,LecDate,StartTime,AM/PM1,EndTime,AM/PM2)values("&cboBtch.Tag&","&cboBtchTime.Tag&","&cboStd.Tag&","&cboYear.Tag&","&cboBtchNoSchl.Tag&","&cboBtchNoColl&","&cboBtchType.Tag&","&cboTeacher.Tag&",'"&txtDays.Text&"',#"&DT1.Value&"#,'"&txtStrtTime.Text&"',"&cboTime1.Tag&",'"&txtEndTime.Text&"',"&cboTime2&")",con,adOpenDynamic,adLockOptimistic Callcleaner(Me)'Cleaningalltextboxesandcomboboxes. MsgBox"SuccessfulySave!!",vbInformation,"CCMS" Mar 1 '11 #1 Post Reply ✓ answered by debasisdas Try renaming the following columns in the database table and re-execute the code. 1. AM/PM1 2. AM/PM2 Share this Question 2 Replies Expert 5K+ P: 8,127 debasisdas Try renaming the following columns in the database table and re-execute the code. 1. AM/PM1 2. AM/PM2 Mar 2 '11 #2 reply P: 5 rahul more Very Very Thanx a lot debasisdas..... now my code is working........ Mar 2 '11 #3 reply Message Cancel Changes Post your reply Join
Way | Trading Add-ins For Excel | Convert Excel Into Calculating Web Pages Excel Web Pages | Produce Clean Efficient VBA Code Every Time | Build Automated Trading Models In Excel | Excel Web Pages | Excel Video Training Forum New Posts http://www.ozgrid.com/forum/showthread.php?t=166104 FAQ Calendar Forum Actions Mark Forums Read Quick Links Today's Posts What's New? Advanced Search Forum HELP FORUMS Excel General Runtime error'-2147217900(80040e14)':Syntax Error in INSERT INTO Statement Excel Training / Excel Dashboards Reports If this is your first visit, be sure http://www.access-programmers.co.uk/forums/showthread.php?t=172485 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 time error selection below. If you don't like Google AdSense in the posts, register or log in above. Click here to view the relaunched Ozgrid newsletter. Results 1 to 10 of 10 Thread: Runtime error'-2147217900(80040e14)':Syntax Error in INSERT INTO Statement Thread Tools Show Printable Version Search Thread Advanced Search June 5th, 2012 #1 sbv View Profile View Forum Posts I agreed to these rules Join Date 5th June 2012 Posts 5 Runtime error'-2147217900(80040e14)':Syntax Error in INSERT INTO Statement Hi, I am 2147217900 syntax error having issues with the following code, it is returning "Runtime error'-2147217900(80040e14)':Syntax Error in INSERT INTO Statement" Error, I am trying to Insert data entered into a form (which contains textboxes and comboboxes ) to Access database which is having both text and numerical fields, following is the code for the form( Im a beginner to this so the code is a simple one, please help) VB: Private Sub fesbmt_Click() Dim res As VbMsgBoxResult Dim en, ef, md, fe, loo, pr, ms, intr, rp, pb As String Dim s2, p2, t2, e2, m2 As Integer If cboen.Value = "" Or cboef.Value = "" Or ComboBox3.Value = "" Or ComboBox6.Value = "" Or s1.Value = "" Or p1.Value = "" Or t1.Value = "" Or e1.Value = "" Or m1.Value = "" Or loocb.Value = "" Or practn.Value = "" Or mstrcb.Value = "" Or intrvl.Value = "" Or respp.Value = "" Or prby.Value = "" Then res = MsgBox("All fields are required!", vbOKOnly) If res = vbOK Then Exit Sub End If If s1.Value > 4 Or s1.Value < 0 Or p1.Value > 4 Or p1.Value < 0 Or t1.Value > 4 Or t1.Value < 0 Or e1.Value > 4 Or e1.Value < 0 Or m1.Value > 4 Or m1.Value < 0 Then res = MsgBox("Warning!-S,P,E,M values should be 1,2 or 3!", vbOKOnly) If res = vbOK Then Exit Sub End If en = cboen.Text ef = cboef.Text md = Com
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... Thread Tools Rate Thread Display Modes 05-23-2009, 06:48 AM #1 Liz Registered User Join Date: May 2009 Posts: 6 Thanks: 0 Thanked 0 Times in 0 Posts Insert queries in VBA code: syntax error -2147217900 Hi All, I am working in ACCESS 2003 and am getting a syntax error: -2147217900 when the VBA code tries to execute strSQL using the below Function. This problem occurs only on the SQL statements that have values other than for the file name (problems are - Samy Deluxe, Black Eyed Peas, TI Paper Trail). The commented out SQL statements in the code below are cut and pasted from the immediate window. Every one of the sql statements work if I cut and paste it from the immediate window and directly assign it to strSQL (replacing the original value). Every one of the sql statements work if I cut and paste it from the immediate window into the SQL View of the Query Designer and click run. I have tried to do the insert for just FileName and Title and still get the same error. In fact, I have tried lots of different combinations. I've also tried doing separate assignments and trims in the ID3Tag. Thank you very much, Liz Public Function AddToDB(tag As ID3Tag, strFileName As String) Dim cn As ADODB.Connection Dim cmd As ADODB.Command Dim strSQL As String Dim strLine As String strSQL = "insert into MP3Desc (FileName, Title, Artist, Album, Date_Year, Comment, Track, Genre) VALUES (" _ & "'" & strFileName & "', " _ & "'" & tag.Title & "', " _ & "'" & tag.Artist & "', " _ & "'" & tag.Album & "', " _ & "'" & tag.Year & "', " _ & "'" & tag.Comment & "', " _ & tag.Track & ", " _ & tag.Genre & ")" Debug.Print strSQL 'insert into MP3Desc (FileName, Title, Artist,