Solved

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

Posted on 2009-04-15
4
221 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

Independent Software Vendors: 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

Suggested Solutions

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…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 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