Link to home
Start Free TrialLog in
Avatar of HLRosenberger
HLRosenbergerFlag for United States of America

asked on

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?
Avatar of Brook Braswell
Brook Braswell
Flag of United States of America image

dim MyConn as adodb.connection
dim gConnectString as string
gConnectString = "Provider=SAOLEDB;DSN=YourDatabaseODBCNAME;OLE DB Services = 0"
 myConn.open gConnectString


ASKER CERTIFIED SOLUTION
Avatar of HLRosenberger
HLRosenberger
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial