Intrinsic Constants issue in VB.Net 2002

R

Ronald Dodge

VB.Net 2002

I'm new to VB.Net stand alone coding. I have done extensive coding in
Office 97, 2K, and 2002 VBA environment within Excel, Access and to some
degree in Word as well as Project 98.

Going over some ADO stuff on Microsoft's MSDN site, I copied the code from
the website,
http://msdn.microsoft.com/library/en-us/ado270/htm/mdtuthellodatacode.asp,
and pasted it into the form. I also setup a reference to the MDAC 2.8
Object Library.

Issue I have:

For all ADODB intrinsic constants, I get the error message, "Name
'<ConstantName>' is not declared.", within the task list of Building errors.

Work Around that I found:

Replace <ConstantName> with <LibraryName>.<EnumGroup>.<ConstantName>

Example:

Replace "adUseClient" with "ADODB.CursorLocationEnum.adUseClient"

By doing the above, that gets rid of the error message, but this would be a
lot of work to have to do while coding. I'd almost would rather use the
numbers rather than have to do this work around, cause this work around
makes it close to being as tough to code as having to code for programs that
has to be version independent as version independent programs can't rely on
code that's compiled during design time.

I realize the code "Option Explicit" is triggering this, but is there some
sort of setting with VB.Net that needs to be set so as to allow all
intrinsic constants to be recognized for those libraries that's referenced
within the project without necessarily having to explicitly calling the
constant starting with the library name? I have not had this sort of issue
when I have done my VBA coding using "Option Explicit" code within the code
window rather it be in standard modules or class modules.
 
R

Ronald Dodge

I have done some things in Access 2002, and currently, would still need to
connect to the MDB/MDE files. However, right now, I only in the learning
process of VB.Net, so for the time being, I'm only trying out things in
VB.Net, so help in this area such as pointers would be greatly appreciated.
I have also attempted to use ADO to connect to the main DB server, of which
when I do the test thing, it indicates that I have succeeded, but when I
click on "OK" within the DB project file that I created separately, it
wouldn't actually create it.

Steps I took to create the connection to the main DB environment:

Right click on Database Reference within the Solution Explorer window
Select "New Database Reference..."
Click on "Provider" tab
Select the provider
Click on the "Connection" tab
Type in the DNS name to the database
Uncheckmark the "Use Blank Password"
Click on "Test Connection"
It comes up with a username and password dialog box, I sign in.
It then returns the message, "Test connection seceeded."

I click on "OK"

It returns the error message, "It is only possible to connect to SQL Server
Desktop Engine databases and Microsoft Access databases with this version of
Visual Studio. BTW, I failed to mention it's only Standard Edition of
VB.Net.
 
C

Chris Dunaway

For all ADODB intrinsic constants, I get the error message, "Name
'<ConstantName>' is not declared.", within the task list of Building errors.

Work Around that I found:

Replace <ConstantName> with <LibraryName>.<EnumGroup>.<ConstantName>

Example:

Replace "adUseClient" with "ADODB.CursorLocationEnum.adUseClient"

At the top of your file add the following imports line:

Imports ADODB.CursorLocationEnum
 
S

Scott M.

You can easily connect to Access with ADO.NET. If you use ADODB (which you
can do), you will be using COM InterOp and not get the best performance. You
will also not be working (natively) in the disconnected data paradigm of
ADO.NET.

Why not just use ADO.NET?
 
C

Cor

Hi Ronald,

In addition to Scott,

Why you use ADO, now you have to do a lot of more with deployment, you have
to import com objects, and because Adonet comes more in front, you can find
every time less in the Microsoft documentation, you get less and less help
in newsgroups, because people who visit those are mostly not the ones who
takes the ancient methodes.

Just my thoughts,

Cor
 
R

Ronald Dodge

Is ADO.NET part of VB.NET Standard Edition 2002? Why I ask, I'm working for
a company that is being very stingy on what they spend on products and not
really looking at my labor time as being as much of a factor, though one
would think they would do that.
 
J

Jay B. Harlow [MVP - Outlook]

Ronald,
ADO.NET is part of the .NET framework itself

So yes it is part of VB.NET Standard Edition.

Hope this helps
Jay
 
S

Scott M.

It's part of the Framework itself, nothing to buy. You should really take
advantage of the all new method of connecting to and working with data
provided in ADO.NET.
 
R

Ronald Dodge

Thank you for your assistance. I have more questions, but I will create a
new thread given I don't want to ask unrelated questions in this thread.
 
J

Jay B. Harlow [MVP - Outlook]

Ronald,
BTW:

David Sceppa's book "Microsoft ADO.NET - Core Reference" from MS Press is
both a good tutorial on ADO.NET plus a good desk reference once you know
ADO.NET!

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top