473,396 Members | 1,785 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,396 software developers and data experts.

Find and bookmark function of adodc to a data control

55
hi! in my program i'm using the find and bookmark function of the adodc control. as the people want me to use a normal data control, when i tried to run it using the same commands i've got an error. is there any other way to do this function through a data control? i'll post on what i've got but i it seems no to work. can anyone help me pls..

Expand|Select|Wrap|Line Numbers
  1. Dim counter As Integer
  2. counter = 0
  3. adoEmployee.Recordset.MoveFirst
  4. Do While adoEmployee.Recordset.EOF
  5.     MsgBox (adoEmployee.Recordset.Fields(0).Value)
  6.     If txtInputID.Text = adoEmployee.Recordset.Fields("EmployeeID").Value Then
  7.         counter = 1
  8.     End If
  9.     adoEmployee.Recordset.MoveNext
  10. Loop
  11. If counter = 0 Then
  12.     MsgBox "Employee ID does not exist", vbInformation, "Find Failure"
  13.     txtInputID.Text = ""
  14.     txtInputID.SetFocus
  15.     adoEmployee.Recordset.MoveFirst
  16.     Exit Sub
  17. End If
Nov 26 '07 #1
6 7062
QVeen72
1,445 Expert 1GB
Hi,

Why Loop through complete Record set. Use "Find" method of ADODC..

Check this out :

Expand|Select|Wrap|Line Numbers
  1. adoEmployee.Recordset.MoveFirst
  2. adoEmployee.Recordset.Find "EmployeeID='" & txtInputID.Text & "'"
  3. If adoEmployee.Recordset.NoMatch Then
  4.     MsgBox "No Matching Record Found"
  5. Else
  6.    MsgBox "Match Found ,..Name Is  " & adoEmployee.Recordset("EmpName")
  7. End If
  8. End If
Regards
Veena
Nov 26 '07 #2
jaz215
55
Hi,

I've tried what you said but it doesn't work. an error i got (object doesnt support property or method) its probably because i'm not using adodc, im using a normal data control (sorry if the naming got you confused) does anyone know how to find using normal data control?

** what i mean about normal data control is the one that's is already in the toolbox without adding components
Nov 27 '07 #3
lotus18
866 512MB
Hi jaz215

Expand|Select|Wrap|Line Numbers
  1. Dim counter As Integer
  2. counter = 0
  3. adoEmployee.Recordset.MoveFirst
  4. Do While adoEmployee.Recordset.EOF
  5.     MsgBox (adoEmployee.Recordset.Fields(0).Value)
  6.     If txtInputID.Text = adoEmployee.Recordset.Fields("EmployeeID").Value Then
  7.         counter = 1
  8.     End If
  9.     adoEmployee.Recordset.MoveNext
  10. Loop
  11. If counter = 0 Then
  12.     MsgBox "Employee ID does not exist", vbInformation, "Find Failure"
  13.     txtInputID.Text = ""
  14.     txtInputID.SetFocus
  15.     adoEmployee.Recordset.MoveFirst
  16.     Exit Sub
  17. End If
When opening your recordset, try this:

Expand|Select|Wrap|Line Numbers
  1.      "Select * From <TableName> Where <FieldName>='" & Text1.Text & "'"
  2.  
Nov 27 '07 #4
jaz215
55
Hi lotus & queen!

I've found out what the problem is, there is no find in datacontrol only findfirst :P (i thought the code was correct as there were no error before i run it) sorry for the trouble you guys! thanks for the help!
Nov 27 '07 #5
QVeen72
1,445 Expert 1GB
Hi,
I've tried what you said but it doesn't work. an error i got (object doesnt support
Hi,

OK, My Coding was for ADODC. and yes, your naming got me confused.
For normal Data Control (call it as DAO's data control)
you can change the code (my previuos post) from
".Find" to ".FindFirst"
You must have got the error in this line..
Rest of the coding remiand same..

Regards
Veena
Nov 27 '07 #6
jaz215
55
Thanks Veena & Lotus!

Sorry about the coding convention it was my first time using the DAO :P
Nov 28 '07 #7

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

Similar topics

1
by: News Central | last post by:
Hi All!, I have a problem refreshing data on the Datagrid control. I execute sql statement directly using the ADODC control and try to make it updated onto the Datagrid control, however, the...
17
by: Danny J. Lesandrini | last post by:
The following code works with a standard MDB to navigate to a particluar record (with a DAO recordset, of course) but it's giving me problems in an ADP I'm working on. Dim rs As ADODB.Recordset...
0
by: Meher Malakapalli | last post by:
Hi I have an application built in VB6. It uses an adodc control bound to several other controls. After installing the .NET framework, the application's data-bound controls no longer display the...
4
by: Raoul Watson | last post by:
I have a form with an AdoDc control associated to a datagrid. The AdoDC uses a "ConnectionString" such as "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=..." this is...
1
by: nkechifesie | last post by:
I have used both Adodc and Data control on the same form, is it okay, would it pose any problem for me?
1
by: pramodrepaka | last post by:
Hello Guys Plz Help me Here is my problem . Unable to retriew the data beteen oracle and vb by using ADODC control i.e if a table consists of Nll values. i am created table...
2
by: SHIBSHIB | last post by:
i prepare a vb project with adodc control where data will be extracted from an access file. to make an .exe file of that project what should be the path in adodc so that the exe file will be executed...
9
by: Neelesh2007 | last post by:
Hi All, I have developed project in VB6.0 with access as backend.I have used ADODC control in VB to retrieve data from access. I have created the Setup file by Package & Deployment. Now when i...
1
by: hussainiyad | last post by:
Dear all, i,m new to v.b and i tried to connect to sqlserver through adodc in a datagrid or datalist , but there was no result in my form, can any one tell me what's the reason and i done every...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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,...

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.