Solved

Just starting out in VB.Net

Posted on 2008-06-12
4
226 Views
Last Modified: 2013-11-26
I am just switching from vb6 to vb.net.  I know, I'm way behind the curve.  I could really use some basic help on making a connection to an Access database and filling a form with a recordset.  VB.Net probably doesn't do it anything like VB6.

I will post my vb6 code to make clear what I am trying to achieve and would greatly appreciate the .net equivalent to the snippet.

Thanks in advance for any help
Public cn As New ADODB.Connection   
Dim strOpen as String
Dim rs As New ADODB.Recordset
 
strOpen = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDest
 
cn.Open strOpen 'open db connection object with connection string set above
 
 rs.Open "Select * from tbluser", cn, adOpenKeyset, adLockOptimistic
 Do While Not rs.EOF
    cboUserID.AddItem (rs.Fields("user_id") & ", " & rs.Fields("last_name") & ", " & rs.Fields("first_name"))
    rs.MoveNext
 Loop
 rs.Close

Open in new window

0
Comment
Question by:PSCTECH
[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
  • 2
4 Comments
 

Author Comment

by:PSCTECH
ID: 21770281
.
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 21770481
Hi,

You can read this PAQ it has some examples how to handle SQL databases http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_23349839.html

You just have to change the Sql to Oledb classes (ex. SqlConnection will be OleDbConnection)

Also you can look examples in MSDN:
http://msdn.microsoft.com/en-us/library/system.data.oledb(VS.80).aspx
0
 
LVL 27

Accepted Solution

by:
planocz earned 500 total points
ID: 21773913
0
 

Author Closing Comment

by:PSCTECH
ID: 31466585
Thanks for the information, I really appreciate it
0

Featured Post

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Introduction to Processes

728 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