Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

SQL statements pure coding

Posted on 2011-04-24
2
Medium Priority
?
234 Views
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!
0
Comment
Question by:ahashash
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 35457053
Yes. You can use the SQLConnection and SQLCommand objects

For Example:

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

dbcmd.Dispose
dbcon.Dispose


http://www.startvbdotnet.com/ado/sqlserver.aspx

http://www.developerfusion.com/article/4278/using-adonet-with-sql-server/2/

http://vb.net-informations.com/ado.net-dataproviders/ado.net-executereader-sqlcommand.htm
0
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 35458978
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:
http://msdn.microsoft.com/en-us/library/ms973824.aspx

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

580 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