473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

connection problem

137 100+
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
Apr 18 '08 #1
8 4930
rski
700 Expert 512MB
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
Expand|Select|Wrap|Line Numbers
  1. psql -h 127.0.0.1 -U postgres db_test
  2.  
what is the error message if not? Are you sure the postgres has set a password, you can check it in pg_user view.
Apr 18 '08 #2
coolminded
137 100+
Can you connect to postgres via command line
Expand|Select|Wrap|Line Numbers
  1. psql -h 127.0.0.1 -U postgres db_test
  2.  
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.
Apr 18 '08 #3
rski
700 Expert 512MB
i'm not a vb6 specialist but is it right wrtting ' ' here
Expand|Select|Wrap|Line Numbers
  1. pwd='postgres@1 32' 
  2.  
(space in password value you wrote by mistake i suppose).
Is postgres loggin something when connect failed (did you configue detailed logs?)
Apr 18 '08 #4
coolminded
137 100+
i'm not a vb6 specialist but is it right wrtting ' ' here
Expand|Select|Wrap|Line Numbers
  1. pwd='postgres@1 32' 
  2.  
(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
Apr 20 '08 #5
rski
700 Expert 512MB
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' ?
Apr 20 '08 #6
coolminded
137 100+
to be clear password is postgres@132 or 'postgres@132' ?
the password is just

pwd = postgres@132
Apr 21 '08 #7
rski
700 Expert 512MB
the password is just

pwd = postgres@132
So why you write here
Expand|Select|Wrap|Line Numbers
  1. Public Sub getconnect()
  2. Set ws = CreateWorkspace("", "cdef", "", dbUseODBC)
  3. Set dbaccount = ws.OpenDatabase("", , False, "ODBC;dsn=PostgreSQL30;uid=postgres;pwd='postgres@1 32'")
  4. End Sub
  5.  
pwd='postgres@132' ?
shouldn't it be
pwd=postgres@132 (without apos)?

If VB needs that syntax sorry for my lack of knolwdge.
Apr 21 '08 #8
coolminded
137 100+
So why you write here
Expand|Select|Wrap|Line Numbers
  1. Public Sub getconnect()
  2. Set ws = CreateWorkspace("", "cdef", "", dbUseODBC)
  3. Set dbaccount = ws.OpenDatabase("", , False, "ODBC;dsn=PostgreSQL30;uid=postgres;pwd='postgres@1 32'")
  4. End Sub
  5.  
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.
Apr 21 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Harry | last post by:
Using Oracle 8i enterprise on win 2000 (sp3) Installed the standard configuration & whenever I make a connection it takes about 10 secs. It's running on a P1900 with 1gb Ram so no reason there...
4
by: James | last post by:
We've had a recurring problem where all of a sudden we get a DBMSSOCN General Network Error on any page that connects to SQL Server. Then we have to reboot the server and everything works fine...
1
by: Mark | last post by:
I know that DB2 LUW version 8 has "connection pooling" that provides a connection concentrator (limits the number of simultaneous connections that can occur). But does it really provide connection...
35
by: Eric Sabine | last post by:
In my Finally block, I was using cn.close (where cn is an ADO.NET connection object, SQLConnection to be exact) and then I came across the following in some microsoft code. If Not cn Is Nothing...
4
by: Rahul Anand | last post by:
Getting SQL Exception when trying to implement Connection based Trasaction using SQL Helper class. I am using the follwing function to execute my stored procs: -=-=-=- ExecuteScalar(ByVal...
5
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
1
by: sherifbk | last post by:
Problem description ============== - I have 4 clients and 1 server (SQL server) - 3 clients are Monitoring console 1 client is operation console - Monitoring console collects some data from...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.