[RESOLVED] Error connecting to Microsoft SQL Server database with VB6
I'm trying to develop a project in VB6 on a Windows XP VM (running on Windows 10) to be installed on a Windows XP system. The connection string is -
Data Source=ipaddress;Initial Catalog=databasename;User ID=username;Password=password
The error I receive is -
[Microsoft][ODBC Drive Manager] Data source name not found and no default driver specified
The General Declarations section includes -
Option Explicit
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim cmd As New ADODB.Command
The reference attached to the project is Microsoft ActiveX Data Objects 2.8 Library.
Any suggestions would be appreciated.
Re: Error connecting to Microsoft SQL Server database with VB6
You need to specify in some way that you want to connect to SQL Server (as opposed to the dozens of other well known database systems), and by implication which connection technology to use, eg:
Provider=sqloledb;Data Source=ipaddress;Initial Catalog=databasename;User ID=username;Password=password
You can find alternatives here: https://www.connectionstrings.com/sql-server/
Re: Error connecting to Microsoft SQL Server database with VB6
Well, that was easy. Thanks for the quick response.