Solved

Help needed with Visual studio Express program 'Hello Data'

Posted on 2011-09-09
7
657 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

809 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