Solved

Help needed with Visual studio Express program 'Hello Data'

Posted on 2011-09-09
7
660 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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 500 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SLMGR Switches Are Not Working On KMS Host 3 141
clicking a shape in a frame array vb6 3 48
TT Auto Dashboard 13 101
C# LINQ ForEach() question 6 84
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

749 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