[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Help needed with Visual studio Express program 'Hello Data'

Posted on 2011-09-09
7
Medium Priority
?
673 Views
Last Modified: 2012-05-12
Hi Experts,
Please see http://msdn.microsoft.com/en-us/library/ms681004(v-VS.85).aspx
It looks like this program does everything I need, so being total newbie I tried to follow the insructions using Visual Studio Express 2010. but its not working.
First problem it says 'create a standard EXE visual basic project', but this option is not there.  I selected Visual Basic Windows Form.  I copied the code from Hello Data into the code window, but I get about 50 errors such as
Error      1      'Option' statements must precede any declarations or 'Imports' statements.      C:\Documents and Settings\ronnie\my documents\visual studio 2010\Projects\HelloData\HelloData\Form1.vb      4      1      My Project
Error      2      'adStateOpen' is not declared. It may be inaccessible due to its protection level.      C:\Documents and Settings\ronnie\my documents\visual studio 2010\Projects\HelloData\HelloData\Form1.vb      14      37      My Project
Error      3      'adUseClient' is not declared. It may be inaccessible due to its protection level.      C:\Documents and Settings\ronnie\my documents\visual studio 2010\Projects\HelloData\HelloData\Form1.vb      48      39      My Project
Error      4      'adOpenStatic' is not declared. It may be inaccessible due to its protection level.      C:\Documents and Settings\ronnie\my documents\visual studio 2010\Projects\HelloData\HelloData\Form1.vb      56      47      My Project
Error      5      'adLockBatchOptimistic' is not declared. It may be inaccessible due to its protection level.      C:\Documents and Settings\ronnie\my documents\visual studio 2010\Projects\HelloData\HelloData\Form1.vb      57      29      My Project
Error      6      'adCmdText' is not declared. It may be inaccessible due to its protection level.      C:\Documents and Settings\ronnie\my documents\visual studio 2010\Projects\HelloData\HelloData\Form1.vb      57      52      My Project


What is wrong its probably something quite simple ?
Thanks
Grace
0
Comment
Question by:GracefBase
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36510221
Error      1
You've probably got something along the lines of:

Imports System
Imports System.Text

Option Explicit On

Open in new window


Not the structure, not the content. "Option" statements need to be the first lines of your file. A corrected version of the above would be:

Option Explicit On

Imports System
Imports System.Text

Open in new window


Error      2 - 6
The compiler cannot find the constants referred to in the errors. This might be a repercussion of the first error, so try correcting that first and then recompiling. If that doesn't correct the issue, then we might need to explore your code.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36510223
Not the structure, not the content
That should have read:

Note the structure, not the content
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 36510268
The unknowns are ADO constants, so you need to set a reference to the Microsoft Active Data Objects Library
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:GracefBase
ID: 36511613
Kaufmed,
Thanks I have got rid of the first error.

Hi Graham,
I have already set a reference to this library and it shows up in the references against the project.
However I keep getting the error
' is not declared. It may be inaccessible due to its protection level.'

Thanks
Grace
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36511675
Try erasing one of the "ad..." parameters up to (but not including) the equals symbol; then hit the spacebar. Intellisense should pop up and list the available options you can use for that variable assignment. Pick the one that closest matches the one you erased, for each occurrence.
0
 
LVL 15

Accepted Solution

by:
x77 earned 2000 total points
ID: 36516066
You can include references from Ado and Vb6 controls on your code.

You says " so being total newbie ".
I think, a Interop project is not the best entry point to learn VB.Net.
Yo get a Vb6 Project and try to code it on Vb.Net.

NetFramework uses ADO.Net. It is full managed code.
The Windows Controls can bind to Ado.Net classes, but can´nt bind to Vb6 Ado.

Ado.Net is most powerfull and has best code organization.
I suggest you find some samples with ADO.Net and DataGridView.

It is easy to include a DataSet on your Project, then Drag a DataTable to your Form and you get a first Data Application With DataBinding and Ado.Net.
0
 

Author Closing Comment

by:GracefBase
ID: 36522055
Thanks for help and clear explanation.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question