Connect to MS SQL Server using VB6

Could anyone provide a snippet of code that shows how to connect to an SQL Server database using VB6?  I assume ODBC is the way to go?  Or maybe ADO?
LVL 1
HLRosenbergerAsked:
Who is Participating?
 
HLRosenbergerConnect With a Mentor Author Commented:
Actually, this work:

csString = "Driver={SQL Server}; Server=sss; Database=ddd;; UID=sa; PWD=xxxx"
0
 
Brook BraswellApplication Development ManagerCommented:
dim MyConn as adodb.connection
dim gConnectString as string
gConnectString = "Provider=SAOLEDB;DSN=YourDatabaseODBCNAME;OLE DB Services = 0"
 myConn.open gConnectString


0
All Courses

From novice to tech pro — start learning today.