Connecting Tech Pros Worldwide Forums | Help | Site Map

Adodc

Member
 
Join Date: Nov 2006
Posts: 82
#1: Jan 8 '07
hi guys,
i have a doubt regarding ado data control. It facilitates us to go to previous record, next record, very first and very last records too. the thing is, i don't know how to implement this feature of the control. it should be written in the WillMove event but what shd be the code.
cd anybody help me with this please?
Thanks in advance.

hariharanmca's Avatar
Lives Here
 
Join Date: Dec 2006
Location: Banglore/India
Posts: 1,987
#2: Jan 9 '07

re: Adodc


Quote:

Originally Posted by aaryan

hi guys,
i have a doubt regarding ado data control. It facilitates us to go to previous record, next record, very first and very last records too. the thing is, i don't know how to implement this feature of the control. it should be written in the WillMove event but what shd be the code.
cd anybody help me with this please?
Thanks in advance.


dim rst as ADODC.Recordset

'MoveFirse
rst.MoveFirse
'MoveLast
rst.MoveLast
'MoveNext
rst.MoveNext
'MovePrevious
rst.MovePrevious
Dököll's Avatar
Moderator
 
Join Date: Nov 2006
Location: Upstate NY - US
Posts: 2,270
#3: Jan 10 '07

re: Adodc


Hi aaryan!

Hopefully the below will help you achieve your goal:

(1)Start by building and access database, if you haven't already; small database call your table Aaryan as one example, perhaps 6 columns...

-UserID, CompanyName, FullAddress, City, State, Zip

(2)While creating this table, keep field data type as TEXT, this will help you in the long run

(3)Run VB 6.0, make a form, Form1, Project1 is by default, you can rename as you wish.

(4)Add 6 TextBoxes, you an name them Text1, Text2...Text6, to make it simpler

(5)You will now need to finds references and/or components, I will take a peek as write this and can tell you the specifics

-Go to Project, select Components from the menu
-Scroll down and check Microsoft Ado Data Control 6.0 (OLEDB)
-You now have a fancy adodc control to the left of your screen,
looks like a yellow container wit two arrows, under General. Please write if you cannot fnd this

(6)Click and Drag adodc1 to Form1, near your TextBoxes

(7)Right-Click on your adodc1 control, find and select ADODC Properties

(8)Use Connection String should already be selected if not, choose build, this'll allow you to find location to your Access database newly created. After finding it, hit Test Connection. If connection is successful, you are golden thus far...

(9)Say OK, get out and back to your Form1

(10)Select Text1, under properties, find DataSource, adodc1 should be in the dropdown, select it. Under CommandType, choose 2- AdCmdTable, below in RecordSource, add Aaryan, as your table name.

(11)Go to DataField, Select the first column of your Access Database, namely 'UserID'

(12) Do/Repeat same for all of your TextBoxes

(13) You can now add you command button, I almost forgot:-)

Run it, and see what happens. You may have noticed you did not wirte any code for this, it is not needed if you wish to keep it simple. If you have data in your database, hitting your adodc1 control arrows will allow you to jump from one record to the next. Please write if this does not make sense or it is not working

Good luck!

Dököll
Member
 
Join Date: Nov 2006
Posts: 82
#4: Jan 10 '07

re: Adodc


hi,
thanks for your reply. you have explained it from scratch. i appreciate your patience. i got the idea. am yet to try the code.
once again thank you.
Dököll's Avatar
Moderator
 
Join Date: Nov 2006
Location: Upstate NY - US
Posts: 2,270
#5: Jan 11 '07

re: Adodc


Please remember, you will not need any code for this. You should be all set with what you have before you...

You're quite welcome ;-)
Dököll's Avatar
Moderator
 
Join Date: Nov 2006
Location: Upstate NY - US
Posts: 2,270
#6: Apr 6 '07

re: Adodc


Quote:

Originally Posted by Dököll

Please remember, you will not need any code for this. You should be all set with what you have before you...

You're quite welcome ;-)

Pushing this forward for all to see, especially You, D...
Reply