Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8642189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:42:54+00:00 2026-06-12T11:42:54+00:00

can anyone tell me how to connect to SQL 2008 using windows authentication thru

  • 0

can anyone tell me how to connect to SQL 2008 using windows authentication thru inno? Currently I’m using ado connection to connect to SQL from inno, the user needs windows authentication option too. Please suggest.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:42:55+00:00Added an answer on June 12, 2026 at 11:42 am

    It’s enough to remove the credential attributes from your connection string (User Id and Password) when we are talking about the example you’ve linked in your question and include one of the following:

    1. Integrated Security=SSPI;
    2. Trusted_Connection=True;

    This answer is based just on this topic, I haven’t tested it.

    Update:

    I don’t know if that’s what you want to do, but I’ll post it here. The following script creates a custom page with radio buttons letting user choose authentication mode and optionally fill the credentials.

    Important:

    There is no protection against SQL injection for those credential fields!

    [Setup]
    AppName=My Program
    AppVersion=1.5
    DefaultDirName={pf}\My Program
    
    [Code]
    const
      LT_WindowsAuthentication = 0;
      LT_SQLServerAuthentication = 1;
    var
      LoginType: Integer;
      UsernameEdit: TNewEdit;
      UsernameLabel: TLabel;
      PasswordEdit: TNewEdit;
      PasswordLabel: TLabel;
    
    procedure OnLoginTypeChange(Sender: TObject);
    var
      EditColor: TColor;
      LabelColor: TColor;
    begin
      LoginType := TNewRadioButton(Sender).Tag;
      UsernameEdit.Enabled := LoginType = LT_SQLServerAuthentication;
      PasswordEdit.Enabled := LoginType = LT_SQLServerAuthentication;
      case LoginType of
        LT_WindowsAuthentication: 
        begin 
          EditColor := clBtnFace;
          LabelColor := clGray;
        end;
        LT_SQLServerAuthentication: 
        begin
          EditColor := clWindow;
          LabelColor := clBlack;
        end;
      end;
      UsernameEdit.Color := EditColor;  
      PasswordEdit.Color := EditColor;
      UsernameLabel.Font.Color := LabelColor;
      PasswordLabel.Font.Color := LabelColor;
    end;
    
    procedure InitializeWizard;
    var
      LoginPage: TWizardPage;
    begin
      LoginPage := CreateCustomPage(wpWelcome, 'DB Login', 'Choose a login type to continue...');
      with TNewRadioButton.Create(WizardForm) do
      begin
        Parent := LoginPage.Surface;
        Left := 0;
        Top := 0;
        Width := LoginPage.Surface.ClientWidth;
        Checked := True;
        Tag := 0;
        Caption := 'Windows authentication';
        OnClick := @OnLoginTypeChange;    
      end;
      with TNewRadioButton.Create(WizardForm) do
      begin
        Parent := LoginPage.Surface;
        Left := 0;
        Top := 20;
        Width := LoginPage.Surface.ClientWidth;
        Checked := False;
        Tag := 1;
        Caption := 'SQL Server authentication';
        OnClick := @OnLoginTypeChange;
      end;
    
      UsernameLabel := TLabel.Create(WizardForm);
      with UsernameLabel do
      begin
        Parent := LoginPage.Surface;    
        Left := 12;
        Top := 44;
        Width := 200;
        Font.Color := clGray;
        Font.Style := [fsBold];
        Caption := 'Username';
      end;
      UsernameEdit := TNewEdit.Create(WizardForm);
      with UsernameEdit do
      begin
        Parent := LoginPage.Surface;    
        Left := 12;
        Top := UsernameLabel.Top + UsernameLabel.Height + 6;
        Width := 200;
        Color := clBtnFace;
        Enabled := False;    
      end;
    
      PasswordLabel := TLabel.Create(WizardForm);
      with PasswordLabel do
      begin
        Parent := LoginPage.Surface;    
        Left := 12;
        Top := UsernameEdit.Top + UsernameEdit.Height + 6;
        Width := 200;
        Font.Color := clGray;
        Font.Style := [fsBold];
        Caption := 'Password';
      end;
      PasswordEdit := TNewEdit.Create(WizardForm);
      with PasswordEdit do
      begin
        Parent := LoginPage.Surface;
        Left := 12;
        Top := PasswordLabel.Top + PasswordLabel.Height + 6;
        Width := 200;
        Color := clBtnFace;
        Enabled := False;    
        PasswordChar := '*';
      end;
    end;
    
    // and in your connection event then use
    case LoginType of
      LT_WindowsAuthentication: 
        ADOConnection.ConnectionString := 
          'Provider=SQLOLEDB;' +                    // provider
          'Data Source=Default\SQLSERVER;' +        // server name
          'Initial Catalog=Northwind;' +            // default database
          'Integrated Security=SSPI;';              // trusted connection      
      LT_SQLServerAuthentication:
        ADOConnection.ConnectionString := 
          'Provider=SQLOLEDB;' +                    // provider
          'Data Source=Default\SQLSERVER;' +        // server name
          'Initial Catalog=Northwind;' +            // default database
          'User Id=' + UsernameEdit.Text + ';' +    // user name
          'Password=' + PasswordEdit.Text + ';';    // password
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone tell me if there is limited SQL support using unixODBC drivers on
can anyone tell me how to select data by date in MS.ACCESS database using
Can anyone tell me, how to make shadow, using UIPageViewController, around of my background
Can anyone tell me how to call the n number of activities from different
Can anyone tell me how to make connection in webconfig file (which don't require
Can anyone please tell me to use which jdbc driver to connect with oracle
every one. I want to connect a remote database using Sql Connection String in
Can anyone tell me what Step-by-Step actions take place when a WCF Clients connect
Can anyone tell me why this code would not be working? $('body').on('test', function() {
Can anyone tell me why the following code fails to submit the form into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.