Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Posts
    2

    Unanswered: DBLIB and NT Authentication

    I'm not sure if this is the correct forum.

    The following code makes ADO object use NT authentication:

    sConn = "PROVIDER=SQLOLEDB;DRIVER={SQL Server};"
    sConn = sConn & "Server=" & sServer & ";"
    sConn = sConn & "Database=" & sDatabase & ";"
    sConn = sConn & "Trusted_Connection=yes"

    Does anyone know what is the equivelent "Trusted" connection string to use with DBLIB?

    We have SQL Server 7.0 and 2000 and applications that call both ADO and DBLIB shared objects. The DBLIB objects use (user_name As String, password As String) to initialize.

    We are trying to convert our applications to NT or WINDOWS Authentication, but these shared DBLIB objects complicate the process.

    Any help is appreciated.

    Thanks.

  2. #2
    Join Date
    Feb 2003
    Location
    Montreal, Canada
    Posts
    117

    Re: DBLIB and NT Authentication

    Try to use this:

    Dim cn as ADODB.connection
    Set cn = New ADODB.connection

    cn.Provider="SQLOLEDB"
    cn.Properties("Data Source").Value= your_server_name
    cn.Properties("Initial Catalog").Value=your_database_name

    'Decision code for login authorization type: WinNT or SQL Server

    If your_condition = True Then
    cn.Properties("Integrated Security").Value="SSPI"
    Else
    cn.Properties("User ID").Value=user_name
    cn.Properties("Password").Value=password
    End If

    cn.Open


    Originally posted by LindaM
    I'm not sure if this is the correct forum.

    The following code makes ADO object use NT authentication:

    sConn = "PROVIDER=SQLOLEDB;DRIVER={SQL Server};"
    sConn = sConn & "Server=" & sServer & ";"
    sConn = sConn & "Database=" & sDatabase & ";"
    sConn = sConn & "Trusted_Connection=yes"

    Does anyone know what is the equivelent "Trusted" connection string to use with DBLIB?

    We have SQL Server 7.0 and 2000 and applications that call both ADO and DBLIB shared objects. The DBLIB objects use (user_name As String, password As String) to initialize.

    We are trying to convert our applications to NT or WINDOWS Authentication, but these shared DBLIB objects complicate the process.

    Any help is appreciated.

    Thanks.
    Steve

Posting Permissions

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