Look up ADO or Active Data Objects. If it is not installed on your machine already, you will need to install MDAC (Microsoft Data Access Components) - the latest vesion is 2.8 and it is freely available from the Microsoft website at
You will need to set a reference to the Microsoft ADO library within VB. Then you can start creating objects. Look up the Connection, Command and Recordset objects on MSDN library. There should also be plenty of code within the VB 5&6 forum forum222 final tip, to easily create connection strings, create a new text file on your desktop and change it's extension to .udl You can then right-click it and set the Properties - you can set the data provider (e.g. Access, SQL, etc), the database & login information to use and test the connection. Then, close the properties dialog and open the udl file in Notepad. It will list the connection string ready to paste into your application.
It is possible to use DAO (an older slightly different way of data access, but not nearly so good on SQL Server, requiring DSNs) - but I wouldn't bother as it's pretty much dead.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.