Solved

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now