Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic


how to find a specific record from the database(access) using adodc.i have two textboxes name and address and a commnd button named find .i want that when i input name and address in that particular textboxes and press find button it show will show
all fields of that specific record .

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
ADODB: Adodc.RecordSet Or Adodc.Command Is More Efficient Way For Update Table

My database is working in Corporate office, where more than 100 hundreds of users are simultaneously accessing the database. is it better to use a SQL procedure with Adodb.Command to update table or Adodb.RecordSet.

The problem I'm facing in RecordSet is 'DeadLock' and unexpected result.

My doubt is that " which method is faster and efficient, Command or Recordset".

Porting ADODC To Non-ADODC
Can anyone point me to an article that shows how to port an application from using ADODC to Not-Using-ADODC please?? Many Thanks.

1. How would I be able to populate a DataGrid in VB using code without using an ADODC control?

I already know the following:

<sample only>
Dim objConn As New ADODB.Connection
Dim objCommand As New ADODB.Command
Dim objRS As Recordset
Dim strBookTitle As String

With objConn
.ConnectionString = "Driver=SQL Server;Server=COLOSSI;" & _
"Database=PUBS;User ID=James;Password=TEST"
End With

With objCommand
.CommandType = adCmdStoredProc
.CommandText = "SelectTitleByKeyword"
.ActiveConnection = objConn
End With

objRS = objCommand.Execute(, strBookTitle)

So now that I have the Recordset populated, how would I show the recordset contents in a

2. If I'd be using an ADODC control, how would I call stored procedures and pass parameters?

I have a ADODC control on a form. I would like to set the .datasource property to a string that I read in from a .ini file.

adoTest.datasource = dataStringFromIni

However, this does not seem to work. Any ideas?

adodc.recordset.find does a find first. Is there a way to do a find next?

how can i give the SQL query in command type (CMDTEXT) of ADODC on run time

Help With Adodc-sql

i need to update my database (ms access) here are the codes that i used:

(on form load)
upd = "update translip set tsno = ' ' where code = 'K'"

(on a command button)
adotrans.recordsource = upd

a dialog box shows up which says: "operation is not allowed when object is closed." the update statement works fine because i placed a "on error resume next statement" , i just keep getting the dialog box.

i really need all the help i can get.


1. How would I be able to populate a DataGrid in VB using code without using an ADODC control?

I already know the following:

<sample only>
Dim objConn As New ADODB.Connection
Dim objCommand As New ADODB.Command
Dim objRS As Recordset
Dim strBookTitle As String

With objConn
.ConnectionString = "Driver=SQL Server;Server=COLOSSI;" & _
"Database=PUBS;User ID=James;Password=TEST"
End With

With objCommand
.CommandType = adCmdStoredProc
.CommandText = "SelectTitleByKeyword"
.ActiveConnection = objConn
End With

objRS = objCommand.Execute(, strBookTitle)

So now that I have the Recordset populated, how would I show the recordset contents in a

2. If I'd be using an ADODC control, how would I call stored procedures and pass parameters?

Need Help With ADODC
I am new to this so forgive me if this sounds quite newbish.

I have two data grids which I have populated successully using the control. I am taking one fields (when double clickd on the data grid) and parsing its components into textboxes. This works fine. (Actually double click works, click does not. Anyone know why?)

I also want to be able to extend this action when the adodc control is moved, so the text boxes are populated automatically. How do I do this?

Thank you.

everytime i close the program... it says empty rows cannot be inserted.. any idea how to solve this???

i have use ADODC in my code, but as always i forgot what reference should be added...? can you please tell me what reference should i use!

Please Help With ADODC
Hi Everybody,

Is there a way to load a second ADODC's recordset with data by applying an sql-statement on a different ADODC which is already connected on an Access database containing already records?

Need Help Using Sql On Adodc!
i'm a newby here, and not for long using visual basic.
i really a some help here, on my form i'm using 2 adodc (same database with different tables) which were:inventory (containts: invID, invName,invInStock)as master record and inventory detailed (containts: InvID, InvSerialNumber, InvshellNumber) on datagrid. it looks like this:
| Inventory detailed |
| on datagrid |

the problem was that, i can't group Inventory detailed by InvID which been input on a textbox. the grid just keep listing the full database list in inventory detailed.... i tried to used an sql command using "group by", but it seems useless... can any one help me?

Help With ADODC Plz!
I am using ADODC to display the datatable onto the datagrid but there appeared a problem that the value of the first field in the first row of the datagrid was erased anytime i call the datagrid.
Anyone here plz show me the way! Thanks.

Adodc Help

Can anyone help me please, can anybody tell me i have a table called tblNames and i wont to load the names it to a combo box so i shows them all.

On the Adodc control i put this code on the ConnectionString.

g Code:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DB.mdb;Persist Security Info=False

and in RecordSource i have tblName.

And on the combo box i have datasource setas AdoUser and datafield as first can anyone helpme?

Adodc Help!
Ive got two ado's in one of my forms. Ive linked both ado's two two different tables in my database on ms access. The two tables are linked via relationship. Ive got two text boxes on my form in VB which show a the data from a field in each of the tables. One field in advert category, the other is advert price. When i press run, the price for one advert category1 appears for advert category2, and its all just mixed up. (The wrong prices are placed with the wrong advert category).
So i made a query in my database which included the advert category and price, and i copied the SQL code and placed it in one of the ADO's. (i hope this makes any sense) This worked, and i was happy. But then when i opened my project in VB today the same thing happened again, even though i was using that query this time.
Im really stuck on what to do, and i really need to sort this problem out quickly because its for my computing coursework. so any help would be really appreciated.

How To Use A Adodc In Vb 6.0
how to use a Adodc in vb 6.0 and ms access 2003.
sm file is hare.

VB6 Adodc
i need help regarding adodc, i kinda have a problem with linking files on the database, hope you guys can give me codes about buttons like:

add to database button
edit the databse button
save to database button
update button
delete entries in the database button

hope you guys can help me out...thanks!

I have step up a database, it's works fine on my system. When I send it to someone else they get "Runtime error 91," which I believe means it cannot find the mdb file. I have no idea why this is because I have set the connection string, so it looks in the same folder as the exe. I think it is a sharing access issue.

Heres the source code -

Please help!

ADODC Example
I am currently working with ADODB and now wants to use ADODC can anybody give me examples and demos of ADODC

Using Adodc
I created a project with Access as backend so I used Data to use the access database. Now I am converting the backend to SQL so I am using Adodc. I tried to replace the data refrences with Adodc1 and now the code of the login button looks like this:


Private Sub cmdOK_Click()
If txtUser.Text = "" Or txtPass.Text = "" Then
MsgBox ("Sorry, username or password cannot be left blank")
While Not Adodc1.Recordset.EOF
If Adodc1.Recordset.Fields("UserName") = txtUser.Text And Adodc1.Recordset.Fields("Password") = txtPass.Text And Adodc1.Recordset.Fields("Role") = "User" Then
frmLogged.lblUser.Caption = txtUser.Text
frmLogged.lblPass.Caption = txtPass.Text
Unload frmLogin
Exit Sub
ElseIf Adodc1.Recordset.Fields("UserName") = txtUser.Text And Adodc1.Recordset.Fields("Password") = txtPass.Text And Adodc1.Recordset.Fields("Role") = "Administrator" Then
frmAdmin.lblUser.Caption = txtUser.Text
frmAdmin.lblPass.Caption = txtPass.Text
Unload frmLogin
Exit Sub
End If
PNR = PNR + 1
Adodc1.Recordset.Fields("UserName") = txtID.Text
Adodc1.Recordset.Fields("Password") = txtFirst.Text
Adodc1.Recordset.Fields("Role") = "User"
Adodc1.Recordset.Fields("PNRNo") = PNR
End If
End Sub

On running the program it is giving the error "Object variable or With block variable not set" while highlighting "
Adodc1.Recordset.MoveFirst" . Help please.

I am running into problem when i write some code in this event of the ADODC named fox_data.. although i don't change this... but the error says that this method's description is changed from the method with same name blah blah.. what could be the possible cause?

VB Code:
Private Sub fox_data_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub

wat is the difference between adodc and data control? are they link to ADO or DAO?...i am confuse.can any one help..thanks

When I let install I get an error while register adodc.tpl
If I ignore this, my program works but because I want to distribute my program I would like if this error gets away.

Sorry, slight mistake.
Use Refresh there is no Update.

I am really confused now. From this board, I "tried" the ADO but keep coming up with an error: "unrecognized data format ....."

I have installed service pac 3, 4 and even 5 (runtime..).

I am using Access 2000 and VB6.

What the H#$% is the difference and when would you really want to use either one of them. AND, how do you recognize the dataformat of Access 2000


Hey all!!!

Why does this work:

SELECT master.* FROM master WHERE master.personal_id = ("BG")

But not this:

Private Sub Command3_Click()
Dim nme As String
nme = InputBox("Enter user name")
Adodc1.RecordSource = "SELECT master.* FROM master WHERE master.Personal_ID = (nme) "
End Sub

Gets error: No value given for one or more required parameters


thanks for any help!!

When I make a SQL selection in the RecordSource e.g.

select Length,Temperature from Tester order by length

and write a connection string

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingslrhplMy DocumentsLogstor StaTechlr_statech.mdb;Persist Security Info=False

where do I declare that Length is the X-axis and Temperature is Y-axis?

When I make a SQL selection in the RecordSource e.g.

select Length,Temperature from Tester order by length

and write a connection string

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingslrhplMy DocumentsLogstor StaTechlr_statech.mdb;Persist Security Info=False

where do I declare that Length is the X-axis and Temperature is Y-axis?

hi!i'm wilson. I need help on ADODC control. i using the ADODC control to get the database and the data displayed on the datagrid.

i need to link 2 tables and displayed the all data on same datagrid. can it be done ?

FYI, i usign SQL command which written in the property page SQL Command field in the ADODC control - RecordSource. The 2 tables are using same data type and fields. Now, i able to connect one table. how i write the SQL command to coonnect 2 tables? Is that other way to solve the problem?

Here the SQL Command (call one table)


Pro&#039;s Of Using The Ado Over The Adodc
Can someone give me the pro's of using the ado over the adodc control?? Thanks

how can i search for records using ADODC. can anyone give me an example?

=B8,=F8=A4=BA=B0`=B0=BA=A4=F8,=B8=B8,=F8=A4=A4 =C5=A7=C4=D0=A4=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A 4=F8,=B8

can anybody help me out here
my prob is that i dont want the database to be updated only on the clickof a button, instead of directly when text is changed in textboxes.

when i change the text in a textfield and then goto another textfield,the previous field has already been updated.

i dont want this to happen till i press a button.

plz send me some sorta code .....

Please Help With ADODC

I've been trying for hours to sort a problem of mine out, I've never used ADODC before and would just like to know why the following code may not work:
Adodc1.RecordSource = "SELECT * FROM Planner WHERE Date = " & txtDate.Text

I want to refresh the DataGrid based on the date that the user inputted, so it only shows items from that date. Is there something I haven't dimensioned or something?

Any help would be greatly appreciated!



I have been trying to connect a VB (6.0 Pro) interface with Access (2000) db. The problem I have is the error "The MS Jet database engine cannot find the input table or query Site2" when I try to run my VB program. Site2 is the name of my db that is placed in the connect string of the ADODC control. Not sure why the error is referring to a query or table as I believe the name of the db is what should go in the connect string.

When I do the test connection with the db name, Site2, it says it succeeded. When I open the Site2 db it says it is an earlier version and asks if I would like to convert it. If I convert it, I get the error message, "Unrecognized database format".

Please help!

Pls HELp - About Adodc
GOod Day!!!

Im a new VB programmer. I'm creating a simple program using sql as my database.

How can i make my adodc in a read/write mode in able to add, edit,delete or modify my record?

Thanks. Godspeed

heres my code:

Adodc1.UserName = "sa"
Adodc1.Password = "sa"

'Adodc1.RecordSource = ("delete * from t_oeb_lock where pl_lock = '" & txtSN.Text & "'")

With Adodc1.Recordset
.Find ("pl_lock = '" & txtSN & "'")

If .EOF Then
MsgBox ("NO RECORD FOUND!!!")'this msg will never be displayed
cmdUNLOCK.Enabled = False
cmdCLEAR.Visible = False
cmdCLOSE.Visible = True
txtSN.Text = ""
txtUI.Text = ""

If RET = OK Then
Unload Me
End If

End If
End With


i have a problem in the ADODC!
when i want to move my proj from 1 place to another (other dir i.e) or when i want to package it and install it in diff path, the ADODC control can't find the DB, even if i tell him in the design time, (connection=...) it keeps look for the DB in its first place, and then assign the new path.
hope i m being understood
sorry for the english



i have a database(access).i have connected the database using adodc.i have one form named dir in which there is two textboxes and command button named search.i want that when i enter name and address on that particular textboxes and press search button it search out the other fields of that particular name and address field entered in that textboxes.i have frame on that same form containing several textboxes ,whose textboxes are datafield bound which is visible only when only matching result is found else it will remain invisible.i have tried to find by writing the code as :-
on error goto err
adodc.recordset.find "name=" & text1.text and "add=" & text2.text,,adsearchforward,1
msg no matching result found
                            but this code is not working
please help me by sending the code for above problem.


i am using adodc control with a flexgrid. the problem is that for instantaneous reflection of changes in the table, i have to refrest the adodc control twice. does anybody know what the problem might be??


I want to use ADODC.
When I set its property to an access database(.mdb) connection is successful.
i am using jet 4.0 OLEDB provider.
but when I give a password to that database in Access and again try to set it to adodc, it gives following error:

Test connection failed because of an error in initializing provider. %1

What could be the problem?

Vb 6 Adodc
i am using adodc control to connect the database & data grid to edit it.
i want to open records from database according which billno = val(text1.text).
i had write a query as follow
"select * from table1 where billno = val(text1.text)"

but it dose not work
please help me

Mp3 And Adodc
Hi, Is there a way to play an mp3 from a database list and have it go through to EOF?.

I have tried to use the windows media control and it works fine with the openfile routine but when I try to put it in a loop and bind it to my adodc1, it doesn't work (well it does go through the database but doesn't play anything. I have made the filename = text1.text.

It has to be as simple as making pie but this baker seems to have over cooked his brain and the pie won't turn out right.

Could someone please help me.

Kindest Regards,


Edited by - cam on 10/25/2002 6:22:09 PM

Adodc And SQL
i am trying to use the following code from adodc.
b]SELECT * FROM tblTuition WHERE StudentID = " & frmTuition.txtStudentID.Text & "

using RecordSource and Command type 8 which is 8 - adCmdUnknown and entering the SQL statement in the command text SQL and when i run it i get the following error (Data type mismatch in criteria expression)

teh SQL i am using is:

SELECT * FROM tblTuition WHERE StudentID = " & frmTuition.txtStudentID.Text & "

if i type it as the following:

SELECT * FROM tblTuition WHERE StudentID = 4;

it will work and it gives me the records i want. so i think i doing something wrong at the last part of the SQL statement.
StudentID is a number.

Thank you in advance,

SQL And Adodc
I am trying to get mny head around SQL within an Adodc.... I am nto using it in the code but in the properties of the Adodc at the moment... and displaying the results in a pie chart on the form.

I am ok connecting the adodc and sql command to a database with one table and many fields within it... but what I cant seem to do is get the SQL right for conencting to 1 table if i have many in the db... and displaying the results in he pie chart... am i lol...

Heres my db layout... DB called: bowling Table Im trying to conenct to: Tournament and Fields: Name, League, Total Scr and Date..

Heres what i want it to do...
Shwo the bowlers name in the lblname.caption array by order of league whereby the league is 'Monday' and the SUM of Total Scr in the lblvalue.caption boxes in which they are set in array...

The code I have briefly tried to do is this:

SELECT Tournament.Name FROM Tournament GROUP BY Tournament.League


I am a VB learner with huge ideas!! push yourself and you shall learn more

First Project: (Forever GROWING!!)

I aim to assist the Ten Pin Bowling Instructors around the world with this!!!!

Help Me With Adodc
is simple a need create a conncection string with adodc that works in all computers, independently of drive that the app is installed, for example with contral data, i wrote in database name than : app.path & "dbname" but i do tha in form load, now how i do the same for the adodc ?

sorry by the english...


hi everyone,
whats wrong with my sql? their is an error "syntax error in from clause"

Private Sub cmdSearch_Click()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:CGriefcaseDatabase.mdb;"
Dim SEARCH As String
Dim Clientname As String
SEARCH = txtSearch.Text
Adodc1.CommandType = adCmdText

' it started here
' my database is the name of my database
' my table name is creditmain
' i have the following fields creditsurname, creditgivename, creditcurrent

Adodc1.RecordSource = "SELECT * from database WHERE creditmain LIKE '%" & SEARCH & "%'"

'the error is in here "syntax error in from clause"
' all i want to know is how i'm going to write an sql ;
'in my textbox i can search and the current credit will be display in the listbox

If Adodc1.Recordset.EOF Then
MsgBox "No record found matching " & SEARCH & "!!!"
End If

Do Until Adodc1.Recordset.EOF
List1.AddItem (Adodc1.Recordset.Fields(1))
If Adodc1.Recordset.EOF And Adodc1.Recordset.RecordCount > 1 Then
MsgBox "Records Found"
End If
End Sub

please help me guyz... its really hard for me to solve this problem...
thanks in advance for reading this problem....
any suggestion is highly appreciated friend.....

iam facing an using an insert query.
error message is as follows
there was error in creating record set. syntax error in query expression 'ABC_54_78_XY.LER'.
help me

I am using the adodc to scroll through records in a database. I would like to set the connection string property at run-time so that I can specify it to go to "App.path" instead of a place where the database always has to be. Since this is going to run off of a lot of people machines it would be easier for it to look at the current directory.

Any ideas?


adodc1 - invoice
adodc2 - customer
textbox1 = invoice.invoice_no
textbox2 = customer.customer_name
1. how can I set filter on adodc1 ? Let's say set filter to invoice_date=now
2. how can I display customer_name in textbox2 ? (relation = invoice.customer_code)

Thank you !

Copyright 2005-08, All rights reserved