Solved

Connect to Oracle - UserID & Password.

Posted on 2001-07-12
7
289 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 50 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
Independent Software Vendors: 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!

 
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

Suggested Solutions

Title # Comments Views Activity
Delphi Spellcheck in Webbrowser 1 77
Printing problem 2 124
Multiple image collision 13 111
Create a path if not exists 7 126
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

751 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