Solved

Using the equivalent of Dlookupand Dmax functions from MS Access in Visual Studio 2008

Posted on 2009-04-15
4
226 Views
Last Modified: 2013-11-26
Hi there
I am new to Visual studio (using the VB mosule) and am battling a bit with returning values from and writing values to an MS Access table.
I need to do a Dlookup and a DMax on the ControlNo field in a table called tblControlNo in an MS Access DB.
Is there a functions list that I can look these up for myself or do I need to go the slog of asking questions of you bgurus every time I need to do some command in VB
0
Comment
Question by:caandal
[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
  • 3
4 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 24146928
DLookup is specific to Microsoft Access and VBA and there currently is no language-integrated query functionality equivalent in .NET. You would need to use the OLEDB namespace library and ADO.NET data objects to query the database.

The next version of Visual Studio (ORCAS) will have something similar to this feature called Linq and DLinq. There is a CTP available if you're interested:

http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx

0
 
LVL 53

Expert Comment

by:Dhaest
ID: 24146933
.NET has several ways to achieve what you want depending on how you're storing your data.

1. LINQ
2. ADO.NET database query (SELECT MyColumn FROM MyTable WHERE MyColumn = SOMEVALUE )
3. .Find Delegate (supported on some collections)
4. Dataset/DataView filters
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 24146935
0
 

Author Closing Comment

by:caandal
ID: 31570365
Hi Dhaest.  You have pointed me in the right direction
tx
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

688 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