?
Solved

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

Posted on 2009-04-15
4
Medium Priority
?
232 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 1500 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
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…
Suggested Courses
Course of the Month14 days, 10 hours left to enroll

771 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