PostgreSQl

How can I log to the databese using
PostgreSQL, i must log in with username and password.
zekoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

IammeCommented:
you must have a database that have a password and a user.......you can use oracle.....and you can connect whit oracle......

another way...........include a password when a transaction began to operate
0
zekoAuthor Commented:
Is there any ORACLE component in Delphi
??? Please give me more information .
Thanks in advance.
Zeko
0
IammeCommented:
no.......you must have an oracle server...
0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

IammeCommented:
if you have a oracle server...i know how to connect using a password
0
zekoAuthor Commented:
My, problem is to connect to the database which is installed on Digital Unix. I need to connect throw PostgreSQL,with username and password.
So, please tell me what I need to do that ????
0
zekoAuthor Commented:
Do I need Interbase server ???
or something like that
????
Please,tell me everything in detail.
0
Phoenix_sCommented:
sounds like you'll have to get hold of vendor ODBC drivers for the postgreSQL database server... maybe also look into client software so your PC can connect to the databse..

you HAVE to have a window into the datasource (ie. a client program of some sort, or a ODBC connection) before you can even TRY to log on with a user name and password.

Then once you can connect via ODBC or the client software, you can then use the username & password you were given by the DB Admin to connect.
0
Phoenix_sCommented:
sounds like you'll have to get hold of vendor ODBC drivers for the postgreSQL database server... maybe also look into client software so your PC can connect to the databse..

you HAVE to have a window into the datasource (ie. a client program of some sort, or a ODBC connection) before you can even TRY to log on with a user name and password.

Then once you can connect via ODBC or the client software, you can then use the username & password you were given by the DB Admin to connect.
0
zekoAuthor Commented:
I have already that driver installed
but my problem is to log in without any password windows, I need something like
Session to AddUsername and Password.
0
IammeCommented:
You must have a session qhit the server of oracle but the server must be phisical i said........you must have a session wuith the server and you must have a rol on the oracle you must define yhe privileges..............whitout server it is impossible
0
zekoAuthor Commented:
where can i download oracle server
??? Is it same Interbase server ???
0
IammeCommented:
no..........it is expensive................really expensive........i said that I had done that but.....no at home.......................i think you should include a password directly on your aplication.......'cause you can not use oracle (You dont have th server(software)
0
zekoAuthor Commented:
Yes I have the server installed on Linux machine. And don't know how ti include password in my application.
That is the problem
I need some source to do that
or component
I tried to do that with simple TTable
component, and then password and usenrame input window popups, Then I typed username and password and opened the database. But I want to do that without Username and Password WINDOW.
0
zekoAuthor Commented:
Just to write some code which will replace popup windows.
Something like :

PostgreSQLSession.AddUsername('user');
PostgreSQLSession.AddPassword('pass');
0
Phoenix_sCommented:
what version of delphi are you using?

and which type (pro, c/s)

you can hold the info you need in the body of a database component by dbl-clicking the component in design mode.

then you can just set the connected property to true and it'll log you in.... and if you use the databaZSe component as the database property of any table/query/stored procs, you don't need to reconnect each time.
0
zekoAuthor Commented:
I am using Delphi 4.0 c/s
and I need to connect without any password dialogs, so if u know write me some code example.
0
geobulCommented:
Hi zeko,

If you use TDatabase component (named MyDB for example) and attach your Table to MyDB (DatabaseName property of TTable), you can do the following:

Write TDatabase.OnLogin event like this:

procedure TForm1.MyDBLogin(Database: TDatabase; LoginParams: TStrings);
begin
  LoginParams.Values['USER NAME'] := 'Your User Name';
  LoginParams.Values['PASSWORD']  := 'Your Password';
end;

Regards, Geo
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zekoAuthor Commented:
Thanks, that's what I need.
0
zekoAuthor Commented:
but how to assign Database1 to my table1
give me some source please
0
geobulCommented:
Hi zeko,

Here I suppose that Database1 and Table1 are placed in a Form1 (They can be owned by DataModule also).

Next code is Form1.OnCreate event.

procedure TForm1.FormCreate(Sender: TObject);
begin
  { First close Database }
  if Database1.Connected then Database1.Close;
  { Assign a name to Database1. Can be what you want }
  Database1.DatabaseName := 'MyDB';
  { Assign an alias to Database1.
  You have to replace 'postgreSQL' with your actual alias name}
  Database1.AliasName := 'postgreSQL';
  Database1.KeepConnection := True;
  { Attach Database1 to Table1. Look here !!! }
  Table1.DatabaseName := Database1.DatabaseName;
  { Assign actual table name to Table1. 'users' in this example }
  Table1.TableName := 'users';
  { Make connection }
  Database1.Open;
  Table1.Open;
end;

Regards, Geo
0
zekoAuthor Commented:
Thanks geo
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.