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

Comparison Of DAO / RDO / ADO

What are the specialised characteristics of a particular type of Data Object, which cannot be done by other type data object ?Can you please send me some cases where that particular task can be done obnly by a particular type of data object?muralirajan

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
ADO/DAO Comparison
Hello again, can someone pls explain to me the differences/pluses and minuses of ADO and DAO and which is the best to use? I'm now starting to get a little confused. Thanks.

VB6 Vs. VB.NET - Comparison
This is sort of a philosophical question : is VB6 "going away" due to lack of MSFT support and their vision for ".NET" ? I've heard that migrating to VB.NET from a learning perspective is pretty tough, but I'd also like to know about features and performance.
1) Is app. development in VB6 a "dead-end" ?
2) Can VB.NET create native DLL's and ActiveX DLL's like VB6 ?
3) Does the code run as fast with VB.NET as VB6 compiled code ?
4) Is it worth the effort to learn VB.NET or should one just start from scratch and learn C# ?
5) What about all of this .NET "interopt" crap I keep hearing about and the "managed" DLL environment ? Is this a pain or performance burden ?

XML Comparison
I am not sure if this is better to do in VB or is it do able in XSLT. Is it possible to compare two xml document that has the same elements and attributes but values are different?

I attached a sample xml document. Lets say I have two of those and want to compare those two files to get the difference, is it possible through automation?

This all may be a little over my head, but I'll throw it out there and see if anyone can help.

I have a need to do what I guess you would call a comparision on two columns in an excel spreadsheet and move the rows around to match up any duplicates. in other words, if 'Orlando' is found in cell A20 AND in B21, B35 and B40, move those rows so that all of the 'Orlando's end up in a grouping.

Is there a way to maybe there was a way to dump the excel into a SQL Server table, massage the data to match up the rows and then dump it back out to a spreadsheet (while preserving the rest of the data in the spreadsheet)???

.wav Comparison
Say I have two .wavs and I want to compare them. Are there any functions that can tell me when a certain sound is lower or higher, or things like that? If you break them down into some kind of binary can you then compare the numbers?

OR Comparison
I have a line:
If Trim(txtReferral(0).Text) = "" Or rs!ReferralAmt1 = 0 Or rs!ReferralDate1 > Date Then Optref(0).Enabled = False Else: Optref(0).Enabled = True
and when all three conditions are not met, it doesn't go to the Else. Where's the logic error? (It definitely shoul be Or, not And)


I have 4 text boxes and a command button.the first three have numbers entered.What i would like to do is at the click of a button have the fourth box update with the smallest value of the other three boxes.
Is their a simple way to do this ??

Comparison Of VB6.0 And VB .Net
Hi all
can anybody give me a general outline about main differences between VB 6 and VB .Net
I want to know in which area does .Net differs drastically from VB6.0
Any links to the related topic will do.
Thank you

Hi All,
Please chekc the following table content
CommKey    Desig    minamount    maxamount    commrate
1    1    1        3499        4
2    1    3500        10000        5
3    2    1        3399        4
4    2    3400        6999        5
5    3    1        1999        3
6    3    2000        4999        4
7    4    1        3799        1
8    4    3800        10000        1.5
9    5    1        3999        0.5
10    5    4000        10000        0.5
11    2    7000        15000        6
12    3    5000        7999        4.5
13    3    8000        20000        6
14    6    1        3499        2
30    6    3500        250001        1
31    6    7777        9999        0.5

now the case is that insert 3500 in minamount
it should tell me it is lying between 3400-6999.

This basically the commission slab
fro saelsperson depebding on designation 'Desig'
can anyone please tell me the query for this.

John Philip

***  Even the Best, did the Bad and Made the Best ***

John Philip

Comparison Of Exe's
Hi everyone
We have an executable running on production and we have the code in VSS. But, we are not sure if this code corresponds to that .exe on production.

Can anyone help me if there are any methods in which this can be found out? Something like differences between these .exes, etc.


> Comparison In VB 6
Hi Guys,

I have been writing a user manual for my system and luckily spotted an error I had missed in the program. Basically the user must input two numbers, the second must be smaller than the first otherwise an error must be raised.

Presuming the code for this would be rather simple I was suprised to see vb messing up the comparison:

Code:If txtOne.Text < txtTwo.Text Then
MsgBox "ERROR",,

Doesn't seem to work, if I enter:

First Number: 50
Second Number: 99

Then it correctly displays an error

However if I enter:

First Number: 50
Second Number: 101

Then it fails to raise an error, no matter what number I enter if it is over 100 the system fails to spot it.

Can anyone suggest why, nothing major but I couldn't imagine it being a system fault in vb.


IP Address Comparison
what i need is a simple control if an IP Address is between 2 pre-defined ip addresses.
For example, I want to check if is smaller than
Does anyone have any idea how to do this?

Date Comparison - HELP!?
Hi, I have a problem. How do I compare a date ( Lev_date = 2002-01-03) with a string to set a value to a control? It does not seem to get the #### part? If I set 2002 instead of #### it works fine. Please help me out here.


If [Lev_date] >= "####-01-01" And [Lev_date] <= "####-03-31" Then
[FirstQuarter] = 1
End If

Comparison Macro

I am having trouble with coding a macro to perform a task on two tables. I need to take each of the values in the first column of table 1 in turn and check if this value is anywhere in the first column of table 2. If there is a match then I need to take the whole row where the value is in table 1 and copy it into a third table.


Hour Comparison
Background: Cell G25 contains a function Today()
Cell K46 contains a function Now() (format HH:MM)
If the time of day is before 7 a.m. in K46 then B3 needs to equal yesterday's date (G25 value -1). If the time of day is 7 a.m. or later, B3 needs to equal today's date (G25 value).
Here is the code. I am continually getting yesterday's date.

Sub ProdDate()
Application.EnableEvents = False
Application.EnableEvents = True

Dim Yest_Date
Yest_Date = Range("G23").Value - 1

If Range("K46").Value < "7:00" Then
Range("B3").Value = Yest_Date
Range("B3").Value = Range("G25").Value
End If

End Sub

I have tried a copy/paste routine instead of Range("B3").Value = Range("G25").Value. Regardless of what I do, I'm getting yesterday's date.


Date Comparison~
i want a function or piece of code that would loop through my loaded list1,
list1 has strings and dates
so i want the code/function which would firstly check if it is string or date, then check the difference with the current date. then if the list date is later than the current date, it will be added to list4.

for ex today the date is 1/1/2000, if the list date is 2/1/2000 the code will add this entry to list4

i think the data type check can be done with isdate() but i am not sure about this date difference thing!

String Comparison
I am comparing two strings, but I want the comparison to be true if the letters are the same, regardless of the case. STUART = Stuart = StuArT all would give true. How can I make this work without individually coding each instance.

Comparison Concept
Hi all, I have a question for the gurus among you

I have 3 numbers (integers) what I want to do is compare those numbers and decide which is highest. The numbers change often and I also need to perform an action when the highest number reaches a certain value.

Now my question is not how to do this as it is not a terribly difficult thing to do and there are a couple of ways to accomplish it, my question is how would you do it and why choose that method? The app will be performing this operation approximately every 5 to 10 seconds so I would like the simplest approach. I considered adding the numbers to an array and then sorting it and watching the top number in the array for the desired value but I am not sure this is the most sensible approach.

Looking forward to your input.


Folder Comparison

I have 2 directories Process A and Process B

Both the files have the same subdirectories and files

I am trying to build a small app that'll check if the folders in "Process A" exists in "Process B" and if a particular folder is missing then it should generate display the missing folder names. it should also be able to check for files within the folders.

How do i go about doing it?

Thanks in advance

edit: oops forgot to add..that "Process A" folder might contain few extra folders that wil definitely not be in "Process B" the comparison tool should ignore those folders

Pls Help.....comparison Of Timings.
Im currently doing a program using visual basic 6.0, I need to display the digital timing in millisecond. But i do not know the codes to display, i can only display the time exactly the same as the computers time but without the millisecond. I can only display the time like eg. (18:46:20) which had the hour, min and sec. But now I required the millisecond as well. eg. (18:46:20:10) which the last column is the millisecond. Does anyone knows the code? Thanks for the help!

Help With Date Comparison
I am having a whale of a time trying to query an access database against a date variable. I am returning every record instead of just the ones that meet the critieria. Can someone look at this code and tell me why it isn't working?

Dim tmpdte As Date
tmpdte = (Date - 14)
MsgBox (tmpdte)

cmpstr1 = "Provider=Microsoft.jet.oledb.4.0;" & _
"Data Source=\vadcaf02psgeshare$ComplianceMSDSLog.mdb;"

Set cmpdb1 = New ADODB.Connection
cmpdb1.Open cmpstr1

tmpsql1 = "SELECT * FROM MSDSLog where AddDate >= " + tmpdte + " ORDER BY AddDate"

Set cmprec1 = New ADODB.Recordset
cmprec1.Open tmpsql1, cmpdb1, adOpenStatic

MsgBox (cmprec1.RecordCount)

I have tried str(tmpdte), format(tmpdte,"mm/dd/yyyy") . Nothing is working. The field AddDate is defined as a Date/Time field in an Access database. There are only two records currently residing here. One record has 06/25/2004 and the other record has 05/11/2004.

File Comparison
Let's say I have two different files, that are simliar. I want to compare the differences between them, then make the first one like the second one.

However, I want people to be able to open up one file (same type as above), and it would make the changes in it, then save it as if it was the second one. Does that make sense? What's a good program to compare the differences?

String Comparison
I wont some text about comparing strings.
I need to find the mistakes . . .
(now I can identify and found mistakes:
missing char, 1 added char, replaced char, "shift over" char (like "abc" -> "acb"))

I'm making a program, which is comparing two strings:
1)original text
2)user typed text (User often makes many mistakes)

Example of text (in Czech):
1) jede jedu jedu jede jedu jedu jede jedu jedu jede jedu jedu
deka deku deka deku deka deku deka deku deka deku deka deku
2) jde jeeeeeeeeedu jede jedu jedu jede jedu jedu jede jedu jedu
deka dkeu dka du deka deku deka deku deka deku keka deku

Tomas Klinsky

Easy Comparison?
Is there an easy way to compare the data in two different listboxes and receive a simple "they're different" or "they're the same"?

String Comparison
It's me again,

If I want to find V2X within in a range of V2P->V4S, is it good to do this?

strZip = "V2X"

If (strZip > "V2P") AND (strZip < "V4S") Then
MsgBox "That is within those limits"
MsgBox "That is not within those limits"
End If

Does that make sense? Am I doing it right? Or am I going to have problems?

Date Comparison

im working on a vb prog as part of a coursework and i am wanting to compare the current date to see if it is between set dates.

if date between september and march then

i am not sure how to do this without comparing the year aswell

any help much apreciated,


Bitwise AND Comparison
is there a bitwise and comparison in visual basic? or do i have to create a function for that?

String Comparison
I've asked a lot of question today.. lol..
however... i encounter another problem again! ARGH!

I tried to compare 2 strings using this:

Dim obj1 As String
Dim obj2 As String
obj1 = "*" & Text1.Text & "*"
obj2 = Text2.Text

If obj2 Like obj1 Then
MsgBox "Similar"
MsgBox "Not Similar"
End If
obj1 is cole, and obj2 is MJ Cole.. and it works

When i move these codes to the actual program i'm working on.. which is a little bit different:

Dim obj1 As String
Dim obj2 As String

obj1 = "*" & txt_query.Text & "*"
obj2 = lst_artist.List(lst_artist.ListIndex)

If obj2 Like obj1 Then
MsgBox "Similar"
MsgBox "Not Similar"
End If

obj1 is taken from a textbox, and obj2 is taken from the name of an item in a listbox.

I'm pretty sure obj1 is cole, and obj2 is MJ Cole... but the it shows out the message box "Not Similar"

Why? Why? Why in the world?

Date Comparison
I am tring to delete expired memberships from an Access DB. This code below does not work. I would like to get away from using a recordset and looping through the entire DB to compare each record with DateDiff then delete it if it is expired. Is there something wrong with this SQL statement? I have verified that the strDate is holding a valid date format in the same format as what is stored in thje DB.

strDate = CDate(strDay & "/" & strMonth & "/" & strYear)
strSQL = "DELETE * FROM Member " &_
"WHERE MEM_EXPIRE < " & strDate
Set objRecordSet = objConn.Execute(strSQL)

Database Comparison
I want to create a comparison application between 2 access databases. But I'm having trouble on figuring out ways of comparing the content of the tables. I've got the "Check" working where it checks that the tables and fields match but the content is proving difficult. I want the comparison to update both ways so that both databases are exactly the same after comparison. The problem is what happens when there is a difference and they come under the same ID number? Also what if they come under the same ID number and if refers to another table? I'm confusing myself here. Just wondering if anyone has created one and give any advice on how data should be inserted when differences are found.

Date Comparison
Have a table where field MyDate is defined as data type Date (format mm/dd/yyyy). Need to select the MyDate only if date is older than 5 days. I am using Today date to calculate 5 days back but having (serious) difficulties getting sql query to work:

'calculate 5 days back
MyDateBack = DateAdd("d", -5, Today)

'sql query string (that does not work)
SqlString = "Select * from MyTable WHERE MyDate <'" & MyDateBack & "'"

Can anybody help ??

Time Comparison
Upon clicking a checkbox on my form, if the time is before 2PM I would like it to display one thing in a label, and if the time is after 2PM I would like it to display something else in the label. Looking at my code I see no reason why it shouldn't work, but if there's one thing I've learned it's that things don't always work when they look like they should! For some reason it only does

lblsent.caption = Date + 1 & " 8:00:00 AM"
no matter what time it is. lol Here's my code:

Private Sub chkSent_Click()
If chkSent.Value = vbChecked Then
If Time < "02:00:00 PM" Then
lblSent.Caption = Date & " 2:00:00 PM"
ElseIf Time > "02:00:00 PM" Then
lblSent.Caption = Date + 1 & " 8:00:00 AM"
End If
ElseIf chkSent.Value = vbUnchecked Then
lblSent.Caption = ""
End If

If chkSent.Value <> udtTemp.intSent Then
blnSentUpdated = True
blnSentUpdated = False
End If
intSave = 0
End Sub

String Comparison
Hello all,

With the help of people on this forum I was able to allow the user to change their password, but for some reason no matter what the user enters in the textboxes the password changes.

I have 2 textboxes:
The first one for the new password and the second to verify the first (same password typed twice).

I want the program to only allow the password to change if the user types in identical words (case sensitive and length).

Here is the code:

vb Code:
Private Sub cmdSavePassword_Click()    Dim strNewPassword As String    Dim strUserID As String            'this makes sure that the user selects something from the combo box    If Combo1.ListIndex = -1 Then        MsgBox "You must select a FDID to continue!", vbExclamation + vbOKOnly, "FDID Needed"        Combo1.SetFocus        Exit Sub    End If        'this reminds the user to enter a new password in both textboxes    If txtPasswordA.Text = "" Or txtPasswordB.Text = "" Then        MsgBox "In order to change the current password you must type the new password in the both text boxes!", vbExclamation            Exit Sub            txtPasswordA.Text = ""            txtPasswordB.Text = ""            txtPasswordA.SetFocus     End If              If txtPasswordA.Text <> txtPasswordB.Text Then        MsgBox "The passwords do not match; Please retype the passwords!"        Exit Sub        txtPasswordA.Text = ""        txtPasswordB.Text = ""        txtPasswordA.SetFocus        Else        'if the passwords are the same, then this will update and save the new password        If Combo1.ListIndex <> -1 Then                strNewPassword = txtPasswordA.Text                strUserID = Combo1.List(Combo1.ListIndex)                 sSQL = "UPDATE tblAdmin SET Adminpassword = '" & strNewPassword & "' "                sSQL = sSQL & "WHERE FDID = '" & strUserID & "' "                cn.Execute sSQL                Debug.Print sSQL                If rs.State = adStateOpen Then                    rs.Close                End If                 rs.Open sSQL, cn, adOpenDynamic, adLockOptimistic                 MsgBox "Password Change Successful", vbInformation + vbOKOnly, "New Account Created"                Combo1.ListIndex = -1                lblOldPassword.Caption = ""                txtPasswordA.Text = ""                txtPasswordB.Text = ""                Combo1.SetFocus        End If    End IfEnd Sub

VB6 And Comparison And Advantages
Hi, Sorry for this ridiculous question but i'm an engineering major in electrical & electrical student who is trying to learn some basic programming. Well, basically i heard from some IT people they would say that can be controlled/updated with internet and VB6 cant. Is that true that VB6 cant gain access to the internet or maybe there will be a lot of complicating over it. Well basically I know how to program with VB6 but if VB6 cant gain access over internet then I suppose I have no choice but to use Would be curious why most people would rather use rather than VB6. What are the pros and cons. THanks in advance. =)

Elegant Comparison??

Well, i was wondering what is the most elegant way to do the following comparison, in particular, and similar simple "if else" statements in general:

If (srcWidth <= desWidth) Then
newWidth = srcWidth
newWidth = desWidth
End If

In C++, it could be done like:

newWidth = srcWidth <= desWidth ? srcWidth : desWidth;

This is not about performance or speed of execution (although it could be in long loops, i'm not sure ), but rather about coding elegance. It's not of high importance really, but it would be nice if the above VB code could be written in a similar way to C++...

And btw, just for the record, is there a built-in numbers comparison method in VB??

I hope some VB experts put forward their thoughts on this!!!


Comparison Between Two Folders
I have two folders that I want to compare the contents to each other. These folders have sub folders in them. I want to compare all of the files from one folder to the files in the other folder based on the timestamp of the files and then display the files that are not a match.

Can this be done?

Thank you

(SOLVED) 2 DB Comparison...
Hi... I have a simple question but I'm kind of clueless on how to do it (And I couldnt' find any information here relating to that).

There is a way of make a full comparison of a table between two DB in one Query?... (The 2 DB are the "same" but because they are in different computers there is the possibility that they had different values)

Tech Info:
- DB - Access
- OS - Windows 2k

I will appreciate any kind of help here....


Date Comparison
I am using this code to insert into the db. If the user clicks on 7/17 on the calendar, then the date entered in the db is 7/15/2006. However, on form load I want to query the db and have everything for the week starting with 7/15/2006 show. I think the code is pretty close because it works for reading in current day, but I'm pretty sure the change is coming from not having the # char. in my weekly. Here is the code. Thank you!

VB Code:
p_cn.Execute "INSERT INTO Weekly_Goals (First_Day_of_Week,.... VALUES (#" & pd_date - Weekday(pd_date, vbSaturday) & "#, .......

VB Code:
p_rs3.Open "SELECT * FROM Weekly_Goals WHERE First_Day_of_Week = #" & (p_Val - Weekday(p_Val)) & "# ", p_cn        If Not p_rs3.BOF And Not p_rs3.EOF Then            p_rs3.Open "SELECT * FROM Weekly_Goals WHERE First_Day_of_Week = " & (p_Val - Weekday(p_Val)) & " ", p_cn

Images Comparison In VB
Hi there.

I want to do the following. I want to capture an image of the screen (i know how to do this) and compare it with another already saved image (that is what i miss). Something like pattern recognition. Do you have any idea of how i ll do this?

Also i d like to know if there is code for capturing a specific area of the screen and not all the pixels. Perhaps this was analyzed in previous topics but i didn't find something similar doing a fast search.


File Comparison
I have a file where the first half has 3 columns separated by tabs and the second half of the same file has up to 10 columns separated by tabs.

I need to compare this file to another file that has the exact same tabular structure.

What is the best way to do a data comparison for differences and similarities?

Thank You

Flag Comparison In VB
Hi everybody and a Happy New Year to all of you! Congratulations and my respect for whoever spends time today here helping people like me ::- D. Why helping? 'cause I do have a question that a seasoned VB person should answer easily. I'm pretty seasoned myself but I really can't find this stuff.

The question is: how can VB do flag comparison? You know... like those constants that SetWindowPos has... SWP_NOSIZE, etc. In C++ if you have some constants like CONSTANT1=2 and CONSTANT2=4, you can combine them using | and check them using &. In VB you can combine them using Or, but checking using And doesn't seem to work! Here's some code.

VB Code:
Public Const KommandAlignTextLeft = 2Public Const KommandAlignTextCenter = 4Public Const KommandAlignTextRight = 8 Dim FlagValue As LongFlagValue = KommandAlignTextLeftIf (FlagValue And KommandAlignTextLeft) = True Then MsgBox "KommandAlignTextLeft is in FlagValue!"

I would have wanted the code above to give a Message Box saying "KommandAlignTextLeft is in FlagValue!" but it doesn't work.

How To Do Time Comparison In VB?
i have a problem in time comparison.
i want to compare system time with given fixed time & want to get result in hh:mm:ss format.
plz help..............

Image Comparison
hi buddies..
i wanna need help about
is there possible to compare to images in VB6.
if yes then
can we tell in % ...
100 % same
75 % same ......

Image Comparison
I want to know how to compare the image through vb code.
My requirement is that When I scan a same page many times, the scanned image has different file size. So when i try to compare the scanned images of the same page , I get the result that the images are differrent. So by opening the image file and comparing bit by bit does not work.
I want to know how to compare the two images without depending upon the file size.

Thanks in advance.


Help On Comparison Problem

I'm using ADO2.1 + SQL7 before, and everything is fine.
Until now, SQL server is upgraded to SQL2K, and now I met a problem on field with "char" datatype.

When inserting a value (e.g. "ABC") to a say char(5) field, sql2k will pad space to the field automatically, i.e. "ABC ".

If running SQL, comparison is fine, but once I retrieve records from that table using ADO and compare the value w/rs,
if rs("field1") = "ABC" then ...
will return False now.

I need to either change the statement to
if trim(rs("field1")) = "ABC" then ...

or change the type to varchar(5), but both are not good idea.

Is there any method to solve this problem?

Thx a lot!

Pls Help.....comparison Of Timings
hi there....
Im currently writing a visual basic program to compare 2 different timing.
timing 1 = 07:12:52:520 <---the last column
timing 2 = 07:12:52:550 is the timing
timing 3 = 07:12:52:720 in millisecond.
timing 4 = ...........
timing 5 = ...........
Then everytime I will need to compare the timing 1 and 2, then followed by 2 and 3, then 3 and 4 and so on..... and extract the timing when there is a difference of 60 millisecond or less ( < 60 millisecond)and then store the timing which has a difference of < 60 millisecond into a file call 'data'

Im using microsoft access to store the timing being read by the reader. Whenever a new tag is read, the timing will be recorded into the table in microsoft access. How do I call out the timing for the calculation? I do not know where the data is being stored. Pls help!

Text Comparison
Hi all

I have some text to be added in the file .

If this text is present already , I do not want to add.

The text can be same with some extra spaces/tabs or blank lines

then how can I take care of it?

can NE body help me with the code ?


File Comparison
Hi all

I want to compare two text files

The files can contain same data with some extra spaces/tabs

or some blank lines how can I do it?

Can NE body help me in the code?

Nahush .

Comparison Application
Please HELP.

I am just learning VB and need to figure out how to do this.

I have 2 txt boxes, 1 command button, and 2 lbl boxes.

The two text boxes will be BeginningPopulation and EndingPopulation. When numbers are entered and I click the "Calculate" command button - I need the code that will calculate the percent of increase or decrease in population and display the percentage of increase or decrease in the appropriate Label control. I also need to to display either a message box to tell me if the population increased or a message box to tell me if the population decreased.

How do it code this under the Command button?

Copyright 2005-08, All rights reserved