 | 
April 18th, 2008, 09:41 AM
| | Member | | Join Date: Mar 2007
Posts: 106
| | connection problem
hi,
i'm using vb6 as a front end and postgresql 8.0.0 as a backend. i just configured the pg_hba.conf file. i changed the method to "md5" and in the database, i gave the name of database. but when i connect with my application, it shows runtime error -3146 , odbc--call failed.
my pg_hba.conf file is as
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# IPv4 local connections:
#host all all 127.0.0.1/32 md5
host db_test postgres 127.0.0.1/32 md5
# IPv6 local connections:
#host all all ::1/128 md5
in my application, i put the password 'postgres@132' that i used while installing the postgres.
my connection string is
Public Sub getconnect()
Set ws = CreateWorkspace("", "cdef", "", dbUseODBC)
Set dbaccount = ws.OpenDatabase("", , False, "ODBC;dsn=PostgreSQL30;uid=postgres;pwd='postgres@ 132'")
End Sub
when i use trust instead of md5 in method in pg_hba.conf, it runs well.
can anybody suggest ?
with regards
| 
April 18th, 2008, 10:10 AM
| | Moderator | | Join Date: Dec 2006
Posts: 250
| | Quote: |
Originally Posted by coolminded hi,
i'm using vb6 as a front end and postgresql 8.0.0 as a backend. i just configured the pg_hba.conf file. i changed the method to "md5" and in the database, i gave the name of database. but when i connect with my application, it shows runtime error -3146 , odbc--call failed.
my pg_hba.conf file is as
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# IPv4 local connections:
#host all all 127.0.0.1/32 md5
host db_test postgres 127.0.0.1/32 md5
# IPv6 local connections:
#host all all ::1/128 md5
in my application, i put the password 'postgres@132' that i used while installing the postgres.
my connection string is
Public Sub getconnect()
Set ws = CreateWorkspace("", "cdef", "", dbUseODBC)
Set dbaccount = ws.OpenDatabase("", , False, "ODBC;dsn=PostgreSQL30;uid=postgres;pwd='postgres@ 132'")
End Sub
when i use trust instead of md5 in method in pg_hba.conf, it runs well.
can anybody suggest ?
with regards | Can you connect to postgres via command line -
psql -h 127.0.0.1 -U postgres db_test
-
what is the error message if not? Are you sure the postgres has set a password, you can check it in pg_user view.
| 
April 18th, 2008, 11:58 AM
| | Member | | Join Date: Mar 2007
Posts: 106
| | Quote: |
Originally Posted by rski Can you connect to postgres via command line -
psql -h 127.0.0.1 -U postgres db_test
-
what is the error message if not? Are you sure the postgres has set a password, you can check it in pg_user view. |
it asks for the password and when supplied ,it connects to the database db_test from the command line and it also shows the password in the pg_user.
| 
April 18th, 2008, 12:19 PM
| | Moderator | | Join Date: Dec 2006
Posts: 250
| |
i'm not a vb6 specialist but is it right wrtting ' ' here
(space in password value you wrote by mistake i suppose).
Is postgres loggin something when connect failed (did you configue detailed logs?)
| 
April 20th, 2008, 05:37 AM
| | Member | | Join Date: Mar 2007
Posts: 106
| | Quote: |
Originally Posted by rski i'm not a vb6 specialist but is it right wrtting ' ' here
(space in password value you wrote by mistake i suppose).
Is postgres loggin something when connect failed (did you configue detailed logs?) |
hi rski,
actually, the password is "postgres@132", it's not "postgres@1 32".
it asks password while connecting to server in postgres and after the correct password is provided, it allows to connect
but it doesn't allow me to connect through vb6.
with regards,
coolminded
| 
April 20th, 2008, 06:16 PM
| | Moderator | | Join Date: Dec 2006
Posts: 250
| | Quote: |
Originally Posted by coolminded hi rski,
actually, the password is "postgres@132", it's not "postgres@1 32".
it asks password while connecting to server in postgres and after the correct password is provided, it allows to connect
but it doesn't allow me to connect through vb6.
with regards,
coolminded | to be clear password is postgres@132 or 'postgres@132' ?
| 
April 21st, 2008, 05:32 AM
| | Member | | Join Date: Mar 2007
Posts: 106
| | Quote: |
Originally Posted by rski to be clear password is postgres@132 or 'postgres@132' ? | the password is just
pwd = postgres@132
| 
April 21st, 2008, 06:18 AM
| | Moderator | | Join Date: Dec 2006
Posts: 250
| | Quote: |
Originally Posted by coolminded the password is just
pwd = postgres@132 | So why you write here -
Public Sub getconnect()
-
Set ws = CreateWorkspace("", "cdef", "", dbUseODBC)
-
Set dbaccount = ws.OpenDatabase("", , False, "ODBC;dsn=PostgreSQL30;uid=postgres;pwd='postgres@1 32'")
-
End Sub
-
pwd='postgres@132' ?
shouldn't it be
pwd=postgres@132 (without apos)?
If VB needs that syntax sorry for my lack of knolwdge.
| 
April 21st, 2008, 11:27 AM
| | Member | | Join Date: Mar 2007
Posts: 106
| | Quote: |
Originally Posted by rski So why you write here -
Public Sub getconnect()
-
Set ws = CreateWorkspace("", "cdef", "", dbUseODBC)
-
Set dbaccount = ws.OpenDatabase("", , False, "ODBC;dsn=PostgreSQL30;uid=postgres;pwd='postgres@1 32'")
-
End Sub
-
pwd='postgres@132' ?
shouldn't it be
pwd=postgres@132 (without apos)?
If VB needs that syntax sorry for my lack of knolwdge. | thanx for the reply. mistakely i put extra ( ' ' ) apostrophy in the pwd field.
thanx once again to correct my mistake
with regards
coolminded.
|  |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over network members.
|