Do I have to add referemces for Mid function ?

I am using Mid function in my vb project, but when I ran it,
I got the compiled error told me that object or library function
cannot be found, then Mid function is highlighted. Why ?
LVL 1
tanc02Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Erick37Commented:
There should be a reference to "Visual Basic for Applications" in your program (it should be already checked).  Use the object browser (F2) and search for mid.  You should find Mid MidB Mid$ in the VBA library.
0
Éric MoreauSenior .Net ConsultantCommented:
This is a problem that I have too. What I do is to add the reference to the library before the word containing the error (for example VBA.Mid).

I had already check to be sure that VBA is in my references and it was there!
0
tanc02Author Commented:
I have about 6 VBA in the references box, which one should I
choose ? And there is one VBA checked already.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Bob LearnedCommented:
Make sure that there isn't any references for the project that say MISSING
0
iyarmakCommented:
I agree that you have to make sure that there isn't any references for the project that say missing.
0
tanc02Author Commented:
Nothing is missing in the references
0
Bob LearnedCommented:
What is the file name for the VBA reference that is checked?
0
tanc02Author Commented:
It is MSVBVM60.dll and others are :

 VEN2232.OLB
 MSVBVM50.dll
 VEABND32.OLB
 VEABN32.OLB

which one should I choose ?
0
Erick37Commented:
I'm using VB5, and the only reference to Visual Basic for Applications I have set is VBA5.dll

I would *assume* you need to reference VBA6.dll, not MSVBVM60.dll.
0
tanc02Author Commented:
There isn't any file called VBA6.dll
0
tanc02Author Commented:
I find the VBA6.dll, but when I want to add it, I got the 'conflict' error. So, I went to remove the other selected VBA, But I can't
because the resource is in use, so how can I add this VBA6.dll ?
0
Bob LearnedCommented:
In VB6, the VBA reference is for MSVBVM60.DLL.

In the immediate window, type ? VBA. and look at the AutoComplete.  Find the Mid function in the pull down.
0
tanc02Author Commented:
Yes, I can see Mid in the pull down, then What ?
0
Bob LearnedCommented:
What happens if you type in the immediate window:

A = "ABCDEFG"
? Mid(A, 1, 1)
? VBA.Mid(A, 1, 1)
0
tanc02Author Commented:
I forget to tell you this :

First, I don't have any problem to use Mid, everything was
fine until I combined the vb program with other vb program.
That other vb program uses ADO to access Ms Access.
0
tanc02Author Commented:
After I typed A = "ABCDEFG" , I got compiled error, saying cannot find the project or library.
This is what I have

 VBA.
 A = "ABCDEFG"
0
Bob LearnedCommented:
What are all the references in the project?
0
tanc02Author Commented:
It is MSVBVM60.dll and others are :

                                     VEN2232.OLB
                                     MSVBVM50.dll
                                     VEABND32.OLB
                                     VEABN32.OLB
     
                                    which one should I choose ?
0
tanc02Author Commented:
It is MSVBVM60.dll and others are :

                                     VEN2232.OLB
                                     MSVBVM50.dll
                                     VEABND32.OLB
                                     VEABN32.OLB
                                     VBA.dll
     
                                    which one should I choose ?
0
Bob LearnedCommented:
No, what are are the checked references for the project, such as Windows Common Controls, Common Dialog, etc (Not just VBA reference)?
0
tanc02Author Commented:
VBA - MSVBVM60.dll
visual basic runtime objects and procedures
visual basic objects and procedures
ole automation
microsoft activex data objects 2.1 library
microsoft activex data objects recordset 2.1 library
vs
microsoft dao 3.51 objects library
and some videosoft vsflex controls.

Above are the checked box in the references
0
Bob LearnedCommented:
Are you mixing DAO and ADO?

Why are there two ADO 2.1 library references?
0
tanc02Author Commented:
I don't know I only use ADO, which one should I remove and why ?


I am using vb6, can vb5 use ADO ?
0
Bob LearnedCommented:
Yes, I believe that VB5 can use ADO.  

You can remove Microsoft DAO 3.51 object library.

I still question what the two ADO references are?  It seems to me like one of those should actually say Microsoft ActiveX Data Objects Recordset 2.0 library.

If you are using ADO, there should only be one reference to Microsoft ActiveX Data Objects 2.1 library.
0
tanc02Author Commented:
It is working right now, I forget to let you know there is
a Missing(videosoft vsflex controls) reference, I took that out.
Why ?
0
Bob LearnedCommented:
I was really trying to get to that way up there in my first comment, because I have had that problem before.  When you said that it wasn't I was confused as to what the problem could be.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.