473,944 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Run-Time error -2147217900(8004 0e14) Syntax error in INSERT INTO statement

5 New Member
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 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 & ", " & cboBtchNoSchl.T ag & ", " & cboBtchNoColl & ", " & cboBtchType.Tag & ", " & cboTeacher.Tag & ", '" & txtDays.Text & "', #" & DTPicker1.Value & "#, '" & txtStrtTime.Tex t & "', " & cboTime1.Tag & ", '" & txtEndTime.Text & "', " & cboTime2 & ")", con, adOpenDynamic, adLockOptimisti c

Expand|Select|Wrap|Line Numbers
  1. (inside Module)
  2.  
  3. Option Explicit
  4. Public con As ADODB.Connection
  5. Public rs As ADODB.Recordset
  6.  
  7.  
  8. Public Function conn()
  9. Set con = New ADODB.Connection
  10. con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\CCMS.mdb;Persist Security Info=False"
  11.  
  12. con.Open "CCMS.mdb"
  13. End Function
  14.  
  15. Public Function reco()
  16. Set rs = New ADODB.Recordset
  17. End Function
  18.  
Expand|Select|Wrap|Line Numbers
  1. (in actual form's code window)
  2. Private Sub cmdSave_Click()
  3. If rs.State = 1 Then rs.Close
  4. Call reco 
  5.  
  6. 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 & ", " & cboBtchNoSchl.Tag & ", " & cboBtchNoColl & ", " & cboBtchType.Tag & ", " & cboTeacher.Tag & ", '" & txtDays.Text & "', #" & DT1.Value & "#, '" & txtStrtTime.Text & "', " & cboTime1.Tag & ", '" & txtEndTime.Text & "', " &cboTime2 & ")", con, adOpenDynamic, adLockOptimistic
  7.  
  8. Call cleaner(Me)     'Cleaning all textboxes and comboboxes.
  9. MsgBox "Successfuly Save!!", vbInformation, "CCMS"
  10.  
  11.  
  12.  
Mar 1 '11 #1
2 6207
debasisdas
8,127 Recognized Expert Expert
Try renaming the following columns in the database table and re-execute the code.

1. AM/PM1
2. AM/PM2
Mar 2 '11 #2
rahul more
5 New Member
Very Very Thanx a lot debasisdas..... now my code is working........
Mar 2 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
5544
by: Balaji | last post by:
I'm trying to do some basic socket programming. here is the line of code which is creating problem.. int FAR PASCAL __declspec (dllexport)(char * addr,int port) Hers is the error I'm getting.. error C2059: syntax error : '('
2
10936
by: kalpana.sinduria | last post by:
Hi all, how to remove the following complle error. When I compiling the code I get the following errors: Compiling... CDrtEachDefFeat.cpp d:\ include\common\cdrtintegfeat.h(39) : error C2143: syntax error : missing ';' before '*'
0
1957
by: MWK | last post by:
Hi All, I don't understand why I get "error c2061: syntax error : identifier" in VS2003. I thought it's fixed in .Net 2003: __hook(&TCP_Client::LineReceived, client, HandlerLineReceived); System::Void HandlerLineReceived(TCP_Client* sender, String* Data)
1
4166
by: IceColdFire | last post by:
I have a VC++.net Win32 console application, however when I compile , I get this error error C2146: syntax error : missing ';' before identifier 'Length' Explain... Location pointed is typedef struct _LIST
1
4380
by: parveen.beniwal | last post by:
hi all i am having the following line of code in my mak file. !IF "$(CFG)" == "" CFG=DesktopCommon - Win32 Release !MESSAGE No configuration specified. Defaulting to DesktopCommon - Win32 Release.
6
2991
by: Pixel.to.life | last post by:
So I have this perfectly fine and running app, that uses managed C++ forms. Problem#1: I pass a Bitmap reference to a class, hoping to modify it in one of the class's methods, so it reflects outside too. Something like this:
6
38113
by: muby | last post by:
Hi everybody :) I'm modifying a C++ code in VC++ 2005 my code snippet void BandwidthAllocationScheduler::insert( Message* msg, BOOL* QueueIsFull,
4
11701
by: srinathvs | last post by:
Hi, I have an access db that I am trying to query from a vb6 program. I've the following code: Dim sSQLQuery As String sSQLQuery = "SELECT * FROM TblData WHERE ID = " & Chr(39) & ID & Chr(39) ID here is equal to 1234567890 MsgBox sSQLQuery the msgbox says: SELECT * FROM TblData WHERE ID = '1234567890 Note that the quotation is missing at the end Set rs = db.OpenRecordset(sSQLQuery, dbOpenDynaset)
2
3979
shashahayes
by: shashahayes | last post by:
I am getting an error on this line, does anyone have any suggestions? here is the error here is line 25 if area > 750 then charge = 200 1>Furniture.cpp
0
11545
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11134
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11307
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9868
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8236
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7397
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6313
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4920
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3518
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.