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

Search A Using Adodc

I have a form with controls bound to adodc.I am trying to search and let the record display in the controls. I have done in Data control with no difficulty at all.In the data control am using the findfirst using the string provided as the criteria.I thought of using the seek method, but am not sure how to use or whether it will work.any ideas or sample code will help.


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Adodc Search
Hi,I'm trying to make a search with adodc, but im getting a strange error during the search, i would like to know if anyone would know what is wrong in my code, thank you very much.

Best regards.

VB Code:
MovieName = varMovie_Name = table field Select Case Combo1(0).ListIndex    Case 0        MovieName = InputBox("Insert the Name of the Movie")        Adodc1.Refresh        criterio = "Movie_Name like '*" & MovieName & "*'"        Adodc1.Recordset.Find criterio        Do While Adodc1.Recordset.EOF            MsgBox ("There isnt any Movie ")            Adodc1.Recordset.MoveFirst        Loop        Adodc1.RecordSource = "select * from videos where Movie_Name like '*" & MovieName & "*'"        Adodc1.Refresh        Adodc1.Recordset.MoveFirstEnd Select

Search With Adodc
Desperately need help with this. I have many textboxes on a form and I need to create a search using one of the textboxes and I need it to display the record found with the search on all the unbound textboxes on the form and when the adodc next button is clicked the next record found to match the search is displayed.

Does anyone know how to do this?


Adodc Search As Integer
Hi guys, a simple answer i need, i hope . How can i search for an integer value? With a string i used this code without the VAL

VB Code:
codFilm = Val(InputBox("Movie code?"))        Adodc1.Refresh        criterio = "Cod_Film like '*" & codFilm & "*' "        Adodc1.Recordset.Find criterio        Do While Adodc1.Recordset.EOF            MsgBox ("No reg's ")            Adodc1.Recordset.MoveFirst        Loop

The error appoints to Adodc1.Recordset.Find criterio

Search Database Using (adodc)
I have a problem on my laboratory exercise(in school)....
How can I search/find the information on my database(Microsoft Access) using Adodc control, I used a textbox for inputting the word to find..
This is my code:
Adodc2.Recordset.Find "'(LName)=&z&'"
but there's an error message saying
"Run-time error '3001':
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another."
Could you help me?

Adodc Search Problems

I am using a adodc component which is connected to a ms access table. I am displaying the information in a datagrid. I can display, add, save etc. The one problem I am facing is trying to search and only display the search results (not a find). The following code is what I am using:

Private Sub CmdSearch_Click()

Dim search As String

search = "SELECT * FROM Table1 WHERE Name = Mr Flibble"

Adodc1.RecordSource = search



End Sub

I don't get any errors but nothing really happens.

Any help, please.


Search ADODC Newbie
hi everyone,

I am currently working on a project for Uni. This projects purpose is to implement a VB 6 program that will allow users to manage their music collection in a MS access database.

So far I have managed to create forms to Add, Modify and delete records from the database using the ADODC component.

I am now trying to create a form which will allow a user to search the database with one field such as artist.
I am not having much luck with this task.

Can anybody give me a hand or reccomend any good resources with information on this subject.



Using ADODC To Search A Record In MS Access
just do you search for a record in MS Access using ADODC? what i meant is how do you code in such a way that if a record is found it would display the info being searched; otherwise it will inform the user that the record is nowhere to be found in the database.


Specific Search With ADODC's *CLUELESS*
Hello y'all!

I've a problem searching a database with ADODC's.

There's this 'Owner' table that contains three types of users: 'R', 'T' and 'V' and depending of which, the Owner_key is made, like R1, V1, R2, T1, T2, V2, R3.... and so on.

The problem is, when I create a new record, I need to make the Owner_key depending on the type (R, T, V) and the LAST key with that number. It's hard to explain, but let's put it this way... I need to make a new 'V' type key, and the last 'V' key is V21, but the last key on the table is T13. The question is, how to search the last record with 'V' (for this example)? I think it's somewhat like

Code:x = "Owner_key like V"

but I don't know how to specify the search to look for the LAST record with V.

UrGeNt HeLp PlEaSe !!!!!

Many, many thanx.
PS.- In case u don't understand it, mail me/reply this and I'll try to clarify.


Search Values In ADODC Bounded MSHFlex Grid
I am having a MSHFlex Grid bounded with ADO Data Control with SQL Database. I would like to have a search functionality to be incorporated on the form at least a predfine column!. Can anybody help me out on this. Preferably a sample code.

Thanks in advance.

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.

A Search Function For Excel 2000 That Will Search All Cells On All Sheets Of A Workbook
I have been buiding a database in excel,...... I know access, but the people I work for refuse to use it so I am stuck with excel, unfortunatly in excel 2000 you can either highlight all your tabs to search the whole book, or you are stuck searching just one page. That and I need something that will also go to next. There have been a few ideas I have tried, none of which worked well at all.

How To Develope A Search Search More Than One Word Document...and List Out
how to develope a seach engine in vb to search for a word in more than one word....document and list out all the word documents.....which contain...the search text..plz help me if u can and also u can mail me to

Adding New Search Engine To The The IE5 Customized Search Window
Hi all
I have a problem that I guess might be solved not necesarilly with VB
and it is:
all I need to do is add a new search engine to the list apears on the search customize.(in my case
Thanks in advance

Create A Search Application Similar To Windows Search In XP.
HI Guys please help.
I want the source code of an appli similar to Win XP search!
For Pictures the thumbnails shud be shown!Thats the main what i want!
How to load a thunbnail as a search result.
Thanks !

UpperCase And LowerCase Interferring In Search & Location Search
Title kinda explains it... In a listbox I have a list of words (Lots of them). Some of these words have capital letters (Names and such) but when the 'user' types in a word in the search textbox with all lowercase letters, it only lists the words that start with lowercase letters


User Types in = "case"

Words in results:


Words not in results, but should show up:

Case of Billy
Case of the cases of caseness (Yes, i know i'm making up words, but these are examples)

So, i need it to search for upper and lower case letters in a word, no matter where it is...

Also, I need the keysearch to pick up on words in the middle of the string...


User types: "case"

Should show but doesn't:

Guitar Case
Violin Case
The fifth word is Case and it won't show up!

So, I hopefully got that squared away 'clearly' if it is even remotely close to that... I'm searching for these things in a text file, using the 'Reading Records' Lesson I used in class. The notepad looks like this:

"Guitar Case"
"Violin Case"
"Case of Caseness"

and i'm using this code to recall the data, so these fixes have to fit in with it:

Code:Private Sub txtboxSearch_Change()
    Dim intfile As Integer
    Dim strSearch As String
    Dim strResult As String
    Dim strPattern As String

    strSearch = txtboxSearch.Text
    intfile = FreeFile
    Open "D:Results.txt" For Input As #intfile
    Do While Not EOF(intfile)
        Input #intfile, strResult
        strpattern = strSearch & "*"
        If (strResult Like strPattern) Then
            listbox01.AddItem strResult
        End if
    Close intfile
End Sub

This search works really well , (except for the problems above of course)... If you can't see how strPattern works, it puts what the user typed in the box with an astrik in front of it so I can use the 'Like' thingy <---(newbie word)

Thanks in advanced!

Search Line 0 Loop And Search Line1
im new to visual basic and was wondering if anyone could help me out.
I have looked around the fourms and all the color changeing seems to deal with words as they are typed. All i want to do is create a button that changes the exsisting keywords in a rich text box red.
Heres what i am trying to do....

Button to color the word "change" in a rich text box red
Use a while loop untill end of file
Start on line 0
If the line contains the word "change" then color it red
Increment line start postion so that is starts on line this time

I have been tring to do this with no luck.
I have tried to use a while loop like below, i have no idea how to get the line number or start it on line 0.
Any help would be great. Thanks.

While (Eof = False) Then
Text1.SelStart = Instr(1, Text1.Text, "change") + 1
Text1.SelLength = Len("change")
Text1.SelColor = vbRed
This code is not texted as i frogot the disk i had the code i was working on. this is what i rember of it.

Search Record From Database Using Search Button
I have a form that has a text field. I want the user to type the keyword in the textfield and hit the search button. The search button should then connect with the ms access database and retrieve the record. could someone please guide me in the right direction to do this. I am very new to the visual basic 6. thanks.

Can I Make A Search Command Search Any Faster?
Ok, you all have been extremely helpful in the development of my first big project. Hopefully I will get it completed here in the next couple of days.

Anyways, I have a database with about 820,000 listings in it, my search feature work great except for the fact that its slow, i need a way, if there is any to make it search faster. Is it possible?

Here is a copy of the search command button code:

Dim strApostrophy As String, strQueryString As String
Dim strCallToFind As String

strApostrophy = "'"
strCallToFind = txtSearch.Text
strQueryString = "Call = " & strApostrophy & strCallToFind _
& strApostrophy
frmCallLookUp.datCallListings.Recordset.FindFirst strQueryString
If frmCallLookUp.datCallListings.Recordset.NoMatch Then
MsgBox "No calls matching!"
End If

Search List Box Multiple Search Items
I want to search a list box for several search criteria and if found move to next criteria if not found put in another list box then move to next criteria!

E.g Search list box for Beacon if found search list box for Yomama if not found add beacon to list2!

This should be easy but i'm stuck!
Please help.

Help Setting Up A Search Button To Search Access Db
Hi I am new to vb6 I used the wizard to set up a form in vb6 to access a access 2000 database. It works great I want to add a button to search the LastName field in my table. I have added the label,text box and command button to the form. I double clicked the command button to get to the code screen. I am not sure what code to add to this button to get it to use the textbox to search the lastname field?
Thank Tim

Coding A 'Search' Button To Search A SQL Database?
I have a SQL database titled, "Test". I have a table in this database, titled, "Customers". Within this particular table, I have quite a few fields:
Counter (primary key), FirstName, LastName, Address, City, State, Zip, CustID.

I have a form that's setup, with a variety of text boxes. In this form, I have a text box setup for the customer's First Name, the customer's Last Name, the customer's Address, another textbox for the customer's City, a ComboBox for the customer's State, and a text box for the customer's zip and customer ID.

The name of these field controls on the form are:
txtFName for the Customer's First name, txtLName for the Customer's Last name, txtAddr for the customer's Address, txtCity for the customer's City, cboState for the customer's State, txtZip for the customer's zip, and txtcustID for the customer's ID.

Now, I a few command buttons on this particular form. I have a 'Delete', an 'Update', and a 'Search' button.

I'm able to easily code the 'Delete' and 'Update' buttons fairly easily, using a Select statement to select the data that's assigned to the textField (and comboBox) controls on the form, and update the fields accordingly within the Database. Everything's been going fairly smooth, until I get to coding the "Search" button.

Beforehand, to see as to whether or not my program was able to work, I had always coded in a:

SQL = vbnullstring
SQL = "Select * From Test..Customers"
Conn.Execute SQL

Shortly after this, I end up assigning the textFields mentioned above, to displaying the information. Essentially, in a database of 10 records, the first record out of the 10 is placed onto my form, listing the customer's first name, etc...

(For the sake of simplicity, I've already coded "Previous" and "Next" buttons to cycle through the records, to see as to whether or not a record has been deleted or updated.)

However, when I try to code the 'Search' button, I'm confused as to how to apply it where a user can enter an information within any text field, and records matching such information will be listed?

For example:

A user enters a last name, and perhaps, a city. How would I go about compiling a SQL statement that will seek out only records matching such things that have been entered, be it a single field, or multiple fields?? I'm guessing concatenating a WHERE statement might help, but I totally blanked out and can't seem to get this working properly. Please help!

Search Box - Change To Multiple Search
Please look at the following code, at the moment it just lets you search one site at a time, id like to somehow have an option usually a checkbox, that lets a user select whether or not they search a single site or all of them with the one keyword:

Option Explicit
Dim mstrName(1 To 100) As String
Dim mstrSite(1 To 100) As String
Dim mstrAdd(1 To 100) As String

Public Sub cboSite_click()
txtMask.Text = mstrSite(cboSite.ListIndex + 1)
txtSep.Text = mstrAdd(cboSite.ListIndex + 1)
End Sub

Public Sub cmdGo_Click()
Call txtSearch_Change
Call OpenInternet(Me, txtAddress.Text, Normal)
End Sub

Public Sub OpenInternet(Parent As Form, URL As String, WindowStyle As T_WindowStyle)
ShellExecute Parent.hwnd, "Open", URL, "", "", WindowStyle
End Sub

Private Sub Command_Click()
Unload Me
End Sub

Private Sub Form_Load()
Me.Caption = "Simple Search - Build " & App.Major & "." & Format(App.Minor, "00") & Format(App.Revision, "00")
'Stay on Top
SetWindowPos hwnd, conHwndTopmost, 100, 100, 505, 72, conSwpNoActivate Or conSwpShowWindow
'Set Sites
Call proSites1
'Set Window Position
Dim xTop, yLeft As Integer
xTop = GetINI("Window Position", "Top")
yLeft = GetINI("Window Position", "Left")
If xTop > (Screen.Height - Me.Height - 500) Then
Me.Top = Screen.Height - Me.Height - 500
Me.Top = xTop
End If
If yLeft > (Screen.Width - Me.Width) Then
Me.Left = Screen.Width - Me.Width
Me.Left = yLeft
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
SetINI "Window Position", "Top", Me.Top
SetINI "Window Position", "Left", Me.Left
End Sub

Public Sub proSites1()
Dim intFree, X As Integer
X = 1
intFree = FreeFile
Open App.Path & "Simple.nfv" For Input As #intFree
Do Until EOF(intFree)
Input #intFree, mstrName(X), mstrSite(X), mstrAdd(X)
X = X + 1
For X = 1 To UBound(mstrName)
If mstrName(X) <> "" Then
cboSite.AddItem (Format(X, "00") & " - " & mstrName(X))
End If
Next X

cboSite.ListIndex = 0
End Sub

Private Sub OsenXPButton1_Click()
Call txtSearch_Change
Call OpenInternet(Me, txtAddress.Text, Normal)
End Sub

Private Sub OsenXPButton2_Click()
End Sub

Private Sub txtSearch_Change()
Dim I, X As Integer
Dim strOut, strSite As String
I = InStr(1, txtMask.Text, "###")
strOut = Left(txtMask.Text, I - 1)
strSite = txtSearch.Text
txtPath.Text = strSite
X = 1
Do Until X = 0
X = InStr(1, txtPath.Text, " ")
If X <> 0 Then
txtPath.SelStart = X - 1
txtPath.SelLength = 1
txtPath.SelText = txtSep.Text
End If
strOut = strOut & txtPath.Text
If Len(txtMask.Text) - I - 2 < 1 Then
strOut = strOut
strOut = strOut & Right(txtMask.Text, Len(txtMask.Text) - I - 2)
End If
txtAddress.Text = strOut
End Sub

Private Sub txtSearch_GotFocus()
txtSearch.SelStart = 0
txtSearch.SelLength = Len(txtSearch.Text)
End Sub

Private Sub txtSearch_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call cmdGo_Click
End If
End Sub

There is about 15 websites in a drop down menu, id prefer to have a little checkbox so if the user chooses to search all 15 sites at once, then they could tick the box, enter the keyword, and search, and 15 windows or tabs etc would open, displaying the result.

Any help please, if I could add anything to the code to make this happen?

Thank you.

I Can't Search The Forum, If I Dont Know What To Search For
I would like to know how to do something, like if I were making an MSN bot, and wanted part of it to be able to change the background of MSN, or change the sounds how would I do that. Does this make any sense at all?

Search Through Recordset Using Binary Search

Is it possible to search through a recordset using a Binary Search?

What I'm doing currently is searching through a recordset of x,y coordinates and looking for the the one that is closest to the current mouse position, and then highlighting that coordinate. It goes too slow!

Instead of looping through each and every point to check it, I'd rather generate a query that includes the x and y coordinates as well as the distance from the mouse cursor (x - xPos) ^ 2 + (y + yPos) ^ 2 (where xPos is the current x position of the mouse, and yPos is the current y position of the mouse)

Then I would like to search through this recordset using the binary search to minimize the # of calculations.......but how would you do that using binary search? How do you move to a specific location in the recordset?????


Search And Search Results In Userform
I have userform with two textboxes at top, one labelled as 'search textbox'.I have listbox labelled as 'search results'.The other textbox labelled 'result textbox'.
If a user enters 3 letters in 'search text box',basing on a formula,results of that formula will display in listbox.After selecting the one of the value from list box the selected value has to be displayed in textbox2 'result textbox'.How this task can be acieved ?
my formula is =index(sheet1a$2:a$100,small(if(left(sheet1a$2:a$100,3)='search textbox'.value,row($1:$99))),row(a1)))
Thanks if any body help in this regard.

Search For Word, Then Continue With A Second Search
I am beating my head on the screen trying to resolve the final step in my project.

I Need to search a text.file for a specific word. "QQQQQ"

Once the word is found mark the location as startOfLine


starting at startOfLine begin a new search for a specific word "RRRRR"

Once the second word is found, mark the location as endOfLine

Using startOfLine and endOfLine, copy all the data between them to put on text5.text box

Dim nextline As String
Dim there As Integer
Open "c:myFile.txt" For Input As 1
Do While Not Eof(1)
    Input #1, nextline
    there = Instr(1, nextline, "QQQQQ")
     If there <> 0 Then
         'found string now = startOfLine
              'Start searching again beginnng with startOfLine for "RRRRR"
              'If found, then found string now = endOfLine
         Copy all data from startOfLine to endOfLine can copy to Text5.text
    Else If there = 0
        'delete last entry from queue
    End If
 Close #1

Anyone have an example of this? or perhaps used this code in an app?


Creating A Search Cmd To Search For Records In Db

I am trying to create a search button that will enable me to input data into text boxes on a form and show the results on a datagrid in a new form.
The form with the search button has 4 text boxes and i want to check the data inputted in the text boxes to see if they match any records in my db and then display the results on the new form. I am using ADO Data Control to access data from my MSACCESS db.
Can somebody PLEASE help me with this as i have been stuck on it for 2 days now and am getting really frustrated!!!

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

Copyright 2005-08, All rights reserved