Connecting to SQL Server using server authentication.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Connecting to SQL Server using server authentication.

  1. #1
    James Guest

    Connecting to SQL Server using server authentication.


    I need to connect to a SQL Server using server authentication.

    Currently I have a SQL Server database define as an ODBC data source.
    I to connect to that data source in my VB pgm using the following:

    txtDsn = "SqlSevDsn"
    txtUid = "My_Id"
    txtPws = "My_Password"
    txtConnectionString = "PROVIDER=MSDASQL;" & _
    "DSN=" & txtDsn & ";" & _
    "UID=" & txtUid & ";PWD=;" & txtPws
    mds_cnn.ConnectionString = txtConnectionString
    mds_cnn.Open

    When mds_cnn.Open executes the following messages are returned :

    Err.Number: -2147217843
    Err.Description: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed
    for user 'My_Id'.
    Err.Source: Microsoft OLE DB Provider for ODBC Drivers

    I suspect that SQL Server's server authentication is causing me the grief.
    Would someone tell me what I'm doing wrong?

    I'm working in a VB 6, SQL Server 7, NT environment.

    Thanks in advance for any help.

    James

  2. #2
    James Guest

    Re: Connecting to SQL Server using server authentication.


    I mixed up the password part of my connection string.

    Sorry about that.

    "James" <tbt102@hotmail.com> wrote:
    >
    >I need to connect to a SQL Server using server authentication.
    >
    >Currently I have a SQL Server database define as an ODBC data source.
    >I to connect to that data source in my VB pgm using the following:
    >
    >txtDsn = "SqlSevDsn"
    >txtUid = "My_Id"
    >txtPws = "My_Password"
    > txtConnectionString = "PROVIDER=MSDASQL;" & _
    > "DSN=" & txtDsn & ";" & _
    > "UID=" & txtUid & ";PWD=;" & txtPws
    > mds_cnn.ConnectionString = txtConnectionString
    > mds_cnn.Open
    >
    >When mds_cnn.Open executes the following messages are returned :
    >
    > Err.Number: -2147217843
    > Err.Description: [Microsoft][ODBC SQL Server Driver][SQL Server]Login

    failed
    >for user 'My_Id'.
    > Err.Source: Microsoft OLE DB Provider for ODBC Drivers
    >
    >I suspect that SQL Server's server authentication is causing me the grief.
    >Would someone tell me what I'm doing wrong?
    >
    >I'm working in a VB 6, SQL Server 7, NT environment.
    >
    >Thanks in advance for any help.
    >
    >James



  3. #3
    Carl Guest

    Re: Connecting to SQL Server using server authentication.


    I assume you mean you want to connect using NT Authentication?

    IF so try somthing like this

    ado_connection.ConnectionString = "Provider=" & strProvider _
    & ";Integrated Security=SSPI;" _
    & "Persist Security Info=False;Initial Catalog=" _
    & strDB & ";" & "Data Source=" & strServer & ";"

    "James" <tbt102@hotmail.com> wrote:
    >
    >I need to connect to a SQL Server using server authentication.
    >
    >Currently I have a SQL Server database define as an ODBC data source.
    >I to connect to that data source in my VB pgm using the following:
    >
    >txtDsn = "SqlSevDsn"
    >txtUid = "My_Id"
    >txtPws = "My_Password"
    > txtConnectionString = "PROVIDER=MSDASQL;" & _
    > "DSN=" & txtDsn & ";" & _
    > "UID=" & txtUid & ";PWD=;" & txtPws
    > mds_cnn.ConnectionString = txtConnectionString
    > mds_cnn.Open
    >
    >When mds_cnn.Open executes the following messages are returned :
    >
    > Err.Number: -2147217843
    > Err.Description: [Microsoft][ODBC SQL Server Driver][SQL Server]Login

    failed
    >for user 'My_Id'.
    > Err.Source: Microsoft OLE DB Provider for ODBC Drivers
    >
    >I suspect that SQL Server's server authentication is causing me the grief.
    >Would someone tell me what I'm doing wrong?
    >
    >I'm working in a VB 6, SQL Server 7, NT environment.
    >
    >Thanks in advance for any help.
    >
    >James



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center