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.. - Dim counter As Integer
-
counter = 0
-
adoEmployee.Recordset.MoveFirst
-
Do While adoEmployee.Recordset.EOF
-
MsgBox (adoEmployee.Recordset.Fields(0).Value)
-
If txtInputID.Text = adoEmployee.Recordset.Fields("EmployeeID").Value Then
-
counter = 1
-
End If
-
adoEmployee.Recordset.MoveNext
-
Loop
-
If counter = 0 Then
-
MsgBox "Employee ID does not exist", vbInformation, "Find Failure"
-
txtInputID.Text = ""
-
txtInputID.SetFocus
-
adoEmployee.Recordset.MoveFirst
-
Exit Sub
-
End If
6 7116 QVeen72 1,445
Recognized Expert Top Contributor
Hi,
Why Loop through complete Record set. Use "Find" method of ADODC..
Check this out : -
adoEmployee.Recordset.MoveFirst
-
adoEmployee.Recordset.Find "EmployeeID='" & txtInputID.Text & "'"
-
If adoEmployee.Recordset.NoMatch Then
-
MsgBox "No Matching Record Found"
-
Else
-
MsgBox "Match Found ,..Name Is " & adoEmployee.Recordset("EmpName")
-
End If
-
End If
Regards
Veena
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
Hi jaz215 - Dim counter As Integer
-
counter = 0
-
adoEmployee.Recordset.MoveFirst
-
Do While adoEmployee.Recordset.EOF
-
MsgBox (adoEmployee.Recordset.Fields(0).Value)
-
If txtInputID.Text = adoEmployee.Recordset.Fields("EmployeeID").Value Then
-
counter = 1
-
End If
-
adoEmployee.Recordset.MoveNext
-
Loop
-
If counter = 0 Then
-
MsgBox "Employee ID does not exist", vbInformation, "Find Failure"
-
txtInputID.Text = ""
-
txtInputID.SetFocus
-
adoEmployee.Recordset.MoveFirst
-
Exit Sub
-
End If
When opening your recordset, try this: -
"Select * From <TableName> Where <FieldName>='" & Text1.Text & "'"
-
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!
QVeen72 1,445
Recognized Expert Top Contributor
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
Thanks Veena & Lotus!
Sorry about the coding convention it was my first time using the DAO :P
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 Datagrid control is not updated with
new data... here is the flagment of codes:
sql = "update MyTable set Col1='test' where Col1='nodata'"
adoMain.Recordset.ActiveConnection.Execute sql
adoMain.Refresh
Set dgdMain.DataSource = adoMain...
|
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
Set rs = Me.RecordsetClone
rs.Find "=" & lngContractID
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
I must site the Heisenberb Uncertainty Principal here, as it
|
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 data from the
recordset contained by the adodc control. Has anyone run into this problem?
Thanks
M
|
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 where the problem begins. The data source will not be known until
the user selects the database.
What is really weird is that if the source is not placed during design time,
during run time the form upon loading will generate an error ("Failed to
|
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?
| |
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 and i got successful connection between oracle and VB6.0 .So i want to add some fields at vb and it should update in oracle(But not all fields) by using Addnew.
But it is not able to add some fileld.
But it is accepting all fields
In a table some...
|
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 normally.
shibshib
|
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 install the software on other PC whole program works fine but ADODC can not establish connection with database. Then if I install VB6.0 then only ADODC works. Can any body guide me how can i create set-up file so that i can install my software without...
|
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 thing to connect with the sql
step 1:Right click the adodc control declared the provider,database,pwd
step2.: In choose Record source i declaled the commad type as "cmd table" and as well the table name
step 3 : Draged a data grid and declared the...
|
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: 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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
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...
| |