Solved

Connect to Oracle - UserID & Password.

Posted on 2001-07-12
7
286 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Filemaker 14 vs Delphi Embarcadero 7 185
Wininet read php file from internet issue 6 80
Downloading email attachments 2 66
Convert GUI app into console app for Win32 Env 5 78
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

943 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now