Solved

Connect to Oracle - UserID & Password.

Posted on 2001-07-12
7
287 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 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Newbie Thread Programming 1 152
Virtuailstring tree compare node issue 14 117
Find and Replace Stream with 0s 8 62
Base1 Encode/Decode 3 77
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 this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 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