Results 1 to 3 of 3

Thread: [RESOLVED] Error connecting to Microsoft SQL Server database with VB6

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Location
    Southeast Michigan
    Posts
    155

    Resolved [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.
    Dave

    Helpful information I've found here so far : The Definitive "Passing Data Between Forms" : Restrict TextBox to only certain characters, numeric or symbolic :
    .NET Regex Syntax (scripting) : .NET Regex Language Element : .NET Regex Class : Regular-Expressions.info
    Stuff I've learned here so far : Bing and Google are your friend. Trying to help others solve their problems is a great learning experience

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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/

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Location
    Southeast Michigan
    Posts
    155

    Re: Error connecting to Microsoft SQL Server database with VB6

    Well, that was easy. Thanks for the quick response.
    Dave

    Helpful information I've found here so far : The Definitive "Passing Data Between Forms" : Restrict TextBox to only certain characters, numeric or symbolic :
    .NET Regex Syntax (scripting) : .NET Regex Language Element : .NET Regex Class : Regular-Expressions.info
    Stuff I've learned here so far : Bing and Google are your friend. Trying to help others solve their problems is a great learning experience

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width