|
-
Nov 15th, 2016, 04:39 PM
#1
Thread Starter
Addicted Member
[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.
-
Nov 15th, 2016, 04:45 PM
#2
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/
-
Nov 15th, 2016, 04:50 PM
#3
Thread Starter
Addicted Member
Re: Error connecting to Microsoft SQL Server database with VB6
Well, that was easy. Thanks for the quick response.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|