Visual Basic and SQL Statements

Go Terps

Senior member
Mar 11, 2000
232
0
0
does anyone know of a good tutorial site for using SQL statements within Visual Basic... I searched google but found nothing good... basically all I want to do is to be able to do Select and Update statements to an Access database... I know VB allows lots of easy data controls and things but this is for a database class project and I must actually write the SQL code myself... school... takes the fun out of life
 

KB

Diamond Member
Nov 8, 1999
5,406
389
126
Visual Basic uses ADO (ActiveX Data Objects) to connect to databases. This replaced RDO (Remote Data Objects) and DAO (Database Active Objects). Do a search for VB projects using ADO. I learned ADO by visiting the site http://www.asp101.com which has tutorials for ADO in ASP (Active Server Pages). You can use alot of the same code in ASP as you can in Visual Basic when it comes to ADO.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0


<< and I must actually write the SQL code myself... school... takes the fun out of life >>



Ouch. You should be saying, "that puts the fun in life." God forbid we write our own code...



<< also I have to manual connect to the database... can't use ADO >>



What do you mean "manually" connect? Is connecting through ADO somehow automatic? You're only other option is to make calls directly to the layers which ADO, as a COM wrapper, abstracts. Download the Data Access SDK from here and start reading up on OLE DB and ODBC. You'll have to know how to make calls to the DLL directly, so if you've done anything with the win32 api in VB, you'll be ok.

Somehow I doubt that your instructor wants you to forego ADO. Using VB to make direct calls to ODBC is rather nonsensical.
 

Go Terps

Senior member
Mar 11, 2000
232
0
0
I just mean that I can't use any of the built in... "Drag and Drop" functionality... I've got the database connection working... but and I can do SQL select statements... I just can't figure out how to get the Update statements to work properly... only 13 more days til graduation... I can't wait