Advertisement

07.22.2008 at 07:49PM PDT, ID: 23587233
[x]
Attachment Details

DAO diehard trying to understand ADO.net

Asked by Basicfarmer in Microsoft Visual Basic.Net

Tags: , ,

Hello Experts, I have decided to try and convert an application written in VB6 to .Net. I read and read and still do not understand this all completely so I am going to ask directly what I am looking for help with at this point. I do not want to use drag and drop data sources and datasets in the explorer. I want to do everything in code. In my application using DAO here is a common example of how I retrieve data. Please show me how to do the same thing in ADO.NET.

Dim db as database
Dim SQL as string
Dim rs as dao.recordset

Set db = opendatabase ("C:\MyDatabase.mdb")

SQL = "SELECT FirstName, LastName FROM Customers WHERE CustomerID = " & customerID & ""
set rs = currentdb.openrecordset(SQL)

if not rs.eof then

     fillCustomerForm

elseif rs.eof then

     msgbox "No Record Found"
   
end if

db.close
set db = nothing

rs.close
set rs = nothing



Start Free Trial
 
Loading Advertisement...
 
[+][-]07.22.2008 at 09:39PM PDT, ID: 22066043

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 07:26AM PDT, ID: 22069614

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Tags: Microsoft, Visual Studio, 2008
Sign Up Now!
Solution Provided By: VBRocks
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.23.2008 at 07:50PM PDT, ID: 22075766

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 07:35AM PDT, ID: 22079579

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 07:49AM PDT, ID: 22079751

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628