SQL statements pure coding

Posted on 2011-04-24
Last Modified: 2012-05-11
Good day,
now in visual studio 2008, is there any way where i can just make normal pure sql statements insert, select and all that and use similar things to DLOOKUP OR DCOUNT in the IDE code view, and relate them to textboxes, kind of like access when u say 'Docmd.RunSQL "blablabla....."' its a bit tuff for me to use the tools in the IDE and the FillBy thinggy, im a newbie and hope u guys can help!
Question by:ahashash
    LVL 83

    Accepted Solution

    Yes. You can use the SQLConnection and SQLCommand objects

    For Example:

    Dim dbcon As New SqlConnection("connection string")
    Dim dbcmd As New SqlCommand("Insert Into ...", dbcon)

    LVL 84

    Assisted Solution

    by:Scott McDaniel (Microsoft Access MVP - EE MVE )
    Are you referring to "bound" Access objects? You can bind controls in .NET, however most experienced developers will tell you this is generall a bad idea.

    You can build datasets/datatables in .NET, and you can use those to bind your controls. AFAIK, you cannot directly bind a control in .NET to a SELECT statement. The funcitons you mention (DCOUNT, for example) don't exist outside of Access.

    Also be aware that most other programming languages are NOT data-bound, since they are intended to be used with a very wide variety of program types. VB.NET, for example, can be used to build a standard data-bound business application, or it can be used to build a game interface. Access is intended to be used with data-bound apps only (although you can do much more with it), and as such has many builtin devices to make that task easier.

    Here's a very basic MSDN article about it:


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    In the previous article, Using a Critera Form to Filter Records (, the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    737 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