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 -
(inside Module)
-
-
Option Explicit
-
Public con As ADODB.Connection
-
Public rs As ADODB.Recordset
-
-
-
Public Function conn()
-
Set con = New ADODB.Connection
-
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\CCMS.mdb;Persist Security Info=False"
-
-
con.Open "CCMS.mdb"
-
End Function
-
-
Public Function reco()
-
Set rs = New ADODB.Recordset
-
End Function
-
-
(in actual form's code window)
-
Private Sub cmdSave_Click()
-
If rs.State = 1 Then rs.Close
-
Call reco
-
-
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
-
-
Call cleaner(Me) 'Cleaning all textboxes and comboboxes.
-
MsgBox "Successfuly Save!!", vbInformation, "CCMS"
-
-
-
2 6200
Try renaming the following columns in the database table and re-execute the code.
1. AM/PM1
2. AM/PM2
Very Very Thanx a lot debasisdas..... now my code is working........
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 : '('
|
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 '*'
|
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)
|
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
|
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.
| |
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:
|
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,
|
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)
|
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
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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,...
|
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...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |