Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / December 2005



Tip: Looking for answers? Try searching our database.

How to obtain maximum navigation features with adodc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sait - 21 Dec 2005 20:47 GMT
I maintain code written in VB 6.0. It uses ADODC to access a database in
SQL-server. Data is beeing displayed on the forms with datagrids bound to the
datacontrols. With adodc it's possible to move next, previous, first and
last.

I want to obtain the navigation-features you may see in Access. In Access
you may have this scenario:
You are pointing at the last record in a table(eg nr 30), and the position
after is EOF. Dispite of that, you may use the right arrow to navigate
'next'. This automaticly adds a new blank record(nr 31), ready for
keystrokes. If you then cancel, and navigate backwards to the previous
record(30), the previous(30) will now become the last record in the dataset
again, and the addNew is canceled and update is canceled for record(31). So
there are still only 30 records.
If you deside to keep record 31 and fill in some data, this is what happens:
On the first keydown (the first character typed) in any field in the row, a
new record (nr 32) is added imidiately. Record 31 is also updated to the
recordset. I suppose this is done with some key-event, but it seems to be
built into Access.

With ADODC you may set Property EOFAction = adDoAddNew, but there has to be
done more to obtain the Access-features described. I wonder if anyone knows
how to code this.
Kevin Yu [MSFT] - 22 Dec 2005 05:53 GMT
Hi,

As far as I know, we can use the Microsoft Data Grid Control to achieve
everything. You can set the AllowAddNew, AllowDelete and AllowUpdate
property of the grid to true and it behaves similar to the Access grid. The
only difference here is only after you add a new row, the blank row after
the new row will appear. Not after a key stroke. But I don't think it a
major difference.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
sait - 22 Dec 2005 15:25 GMT
Thank you very much. I'll look into it after some Christmas celebration, and
let you know if it meet the challenges. I suppose I have to use key-event
too, if it is supported for the control. I have already tried setting
properties for the adodc-controll, and EOFAction is set to adDoAddNew. This
adds a new record when user navigates "next". Problem is that the new record
is updated, even if there is no data. Empty records usally not allowed, and
forces error when lost focus. May be it's better to achieve this with
property settings in the datagrid-control, as you suggest.

Sait

> Hi,
>
[quoted text clipped - 9 lines]
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
Kevin Yu [MSFT] - 24 Dec 2005 04:37 GMT
You're welcome, Sait. The datagrid control is similar to the grid in
Access, but not 100% same. If you really need exactly the same
functionality, maybe you need to customize it to your own one.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
sait - 25 Dec 2005 00:27 GMT
In Access you obtain the same navigation features for records independent of
the controls you add to the form to display data. Suppose you add a textbox
and binds it to the datasource, wich is a field in a table. You will always
be able to navigate to a "new" record, when standing on the last record
updated in the database. You will always have the possibility of canceling
the new record, as long as you do no typing in the textbox. You may click the
box, and still leave it without actually adding a new record, as long as you
keep the fingers off the keyboard.
So to me it seems that this functionality is independent of the controls you
add to the form to display and modify data. So I wonder if this happens as a
result of settings for the ADODC - datacontrol, or may be there are settings
for the recordset as well that determines how the user may navigate?
Most of all I'm interested in finding a general solution on how to
automaticly update a new record on the first keystroke. I suppose I have to
do this with a keydown-event?

Sait

> You're welcome, Sait. The datagrid control is similar to the grid in
> Access, but not 100% same. If you really need exactly the same
[quoted text clipped - 4 lines]
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
Kevin Yu [MSFT] - 27 Dec 2005 09:28 GMT
Hi Sait,

The behavior as you described is not only controlled by the ADODC control.
It also have something to do with the binding controls. Yes, as you know,
if you need to do something when the first key pressed, you can handle the
key events. But I suggest you use the keyup event.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Kevin Yu [MSFT] - 24 Dec 2005 04:37 GMT
You're welcome, Sait. The datagrid control is similar to the grid in
Access, but not 100% same. If you really need exactly the same
functionality, maybe you need to customize it to your own one.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.