473,434 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

Visual Basic 6 <--> Access

I'm reading/writing from Access using both EXECUTE() and Recordset methods.

I get weird errors though. For example I have 5 text boxes bound to fields.
I will change the data in a couple of the text boxes then immediately try to
do a INSERT to add another record. This returns errors like, "operation not
allowed in this context".

Is it possible to force the database to check the value of bound fields, and
immediately write them to the datasource fields in the database?
Adrian
Jul 17 '05 #1
2 3285

"Adrian Parker" <ad***********@NOSPAMsympatico.ca> wrote in message
news:EB********************@news20.bellglobal.com. ..
I'm reading/writing from Access using both EXECUTE() and Recordset methods.
I get weird errors though. For example I have 5 text boxes bound to fields. I will change the data in a couple of the text boxes then immediately try to do a INSERT to add another record. This returns errors like, "operation not allowed in this context".

Is it possible to force the database to check the value of bound fields, and immediately write them to the datasource fields in the database?


Particularly, if I change any of the values of a bound field, then run any
of the following without first using an adorecordset move (movenext, last,
etc), an error occurs:

..requery
..save
..close

etc

Adrian
Jul 17 '05 #2

"Adrian Parker" <ad***********@NOSPAMsympatico.ca> wrote in message
news:wT********************@news20.bellglobal.com. ..

"Adrian Parker" <ad***********@NOSPAMsympatico.ca> wrote in message
news:EB********************@news20.bellglobal.com. ..
I will change the data in a couple of the text boxes then
immediately try to
do a INSERT to add another record. This returns errors like,
"operation not
allowed in this context".

Is it possible to force the database to check the value of bound
fields, and
immediately write them to the datasource fields in the database?
Particularly, if I change any of the values of a bound field, then run

any of the following without first using an adorecordset move (movenext, last, etc), an error occurs:

.requery
.save
.close


As soon as one field of a recordset is edited, the recordset enters the
"Edited" state. When you move next, ADO performs an implicit "Update" on
the recordset. As you have noticed, it does not do that before Requery,
etc.

Basically you just need to check for the edited state, and perform
Update before doing other tasks. So, use something like:
If RS.EditMode <> adEditNone Then
RS.Update
End If
RS.Requery
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Norm | last post by:
I have run into problems from time to time (and this is one of those times) using visual basic to access an external database and perform a basic select from statement. When the table is extremely...
6
by: Greg Teets | last post by:
I am new to VB and Access reports. Is it correct to say that VB and Access have the same report engine or method? After I do all the dragging and dropping, is there a way to see the specs for...
1
by: Beat Scheidiger | last post by:
Hello Can anybody tell me, whether it is possible to import (simple) forms from Visual Basic into Access? Thanks a lot. Beat
5
by: Microsoft | last post by:
Hi, I have Visual Basic .net 2003 (Standard Edition) & SQL Server 2000 Developer Edition. When trying to create a connection in the server explorer from the .net IDE I get a number of problems;...
0
by: arabella79 | last post by:
I have a form that's based on a query. I'm trying to make the form only accept hours worked if there is a pay rate already entered in another form. If not the form will return a message box...
3
by: RichardJB | last post by:
Hi, I am using visual basic in access 2003 and am having a problem with sorting tables which I can't seem to find a solution to, and was hoping that someone might be able to help. I have a...
5
by: technocraze | last post by:
Hi guys, i tried using the AddRecord command (Record operation - Add New Record) provided by MS Acess but the new record is not been appended to the table but instead it has been overwritten. ...
1
by: trinity ricoh | last post by:
Hi all. I have a table created in access. I want to only display certain fields in Visual Basic. For example, you enter in your car's engine size and manufacturer, it references the access...
1
by: nithya jayaraman | last post by:
hi now i am using vb with MS Access ... but i have some information in excel wook sheet , so access that data and store to data grid then find out the average of the sheet 1 and sheet 2 and...
2
by: drogonis | last post by:
Hi everyone. This my first post here so here goes. I have a Visual Basic program that connects to an MS Access db and gets to first record from a specified table and populates the specified fields....
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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,...
0
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...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.