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
Solved

Help needed with Visual studio Express program 'Hello Data'

Posted on 2011-09-09
7
658 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
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft C++ code failing in executable that worked 9 110
Add a task in Outlook from access 11 42
Using MS Code on my Mac 6 68
Can we place a tooltip on the actual vb6 form 5 48
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

828 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