Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Connect to Oracle - UserID & Password.

Posted on 2001-07-12
7
Medium Priority
?
297 Views
Last Modified: 2010-04-06
I've got a small application that connects to an Oracle Database via it's ODBC entry.  The only thing that's wrong with it is that it always prompts for a UserID and Password.

I want to hard-code these so the user does not receieve the prompt.  How do I do this?

MoonCalf.
0
Comment
Question by:MoonCalf
  • 4
  • 2
7 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6276625
Hello

  you need to add database component, and change the property LoginPrompet to false

procedure TForm1.Button1Click(Sender: TObject);
begin
  with Database1 do begin
    Params.Values['USER NAME'] := 'Mohammed';
    Params.Values['PASSWORD'] := 'zzz';
    LoginPrompt := False;
    Connected := True;
  end;
  Table1.open;
end;

if you need the full project, email me at nasman@mogaza.org

Best regards
Mohammed Nasman
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 200 total points
ID: 6276626
Hello

  you need to add database component, and change the property LoginPrompet to false

procedure TForm1.Button1Click(Sender: TObject);
begin
  with Database1 do begin
    Params.Values['USER NAME'] := 'Mohammed';
    Params.Values['PASSWORD'] := 'zzz';
    LoginPrompt := False;
    Connected := True;
  end;
  Table1.open;
end;

if you need the full project, email me at nasman@mogaza.org

Best regards
Mohammed Nasman
0
 
LVL 1

Author Comment

by:MoonCalf
ID: 6276865
Thanks for the reply, but it's not relevant for me to add a database component, or any other for that fact.  I have created a component that creates the DSN and then creates a TQuery to connect to it so that I can execute SQL statements.

The first time I execute an SQL statement the window pops up asking for UserID & password.

Therefore, adding another component will not solve the problem as I can't connect to the database until the DSN has been created and this only happens after the component has been created.

Besides, I tried the code and it didn't work.

Thanks again,

MoonCalf.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 6276887
you could create a tdatabase within your component
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6276898
Hello

  I test my code and it's work fine with me, and I use it, also i test it with the ODBC driver and work fine
  but as i know you can't ignore the oracle login screen without using Database component

Mohammed
0
 
LVL 1

Author Comment

by:MoonCalf
ID: 6276918
Sorry, my mistake.

It does work fine as long as I assure that the DB component is connected before I execute an SQL statement.

Thanks a lot,

MoonCalf.
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6276934
you are welcome :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Integration Management Part 2

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question