Thread: ODBC problems with Visual Basic 6, but in Excel it works

ODBC problems with Visual Basic 6, but in Excel it works

From
"Steffen Brodowski"
Date:
Hello programmers,
 
I try to connect to a postgres database with ODBC and Visual Basic 6.0.
 
The Postgres ODBC driver is 7.03.xx and it runs with Access, Excel and MS-Query without any problems by using a DSN-file.
 
In VB 6.0 I'm using MS-ADO (ADO 2.7) and the same DSN-file an the following error occurs:
 
"The provider can not be found! Perhaps it is not installed correctly."
 
Why it is running with Excel and Access? I think it's because Access and Excel/MS-Query uses DAO and not ADO?!
 
Can anybody tell me, how to use MS-ADO and Postgres ODBC? Whats wrong?
 
Greetings
 
Steffen Brodowski
Germany
 
 
 

Re: ODBC problems with Visual Basic 6, but in Excel it works

From
Andrew Ayers
Date:
Steffen Brodowski wrote:
> Hello programmers,
>
> I try to connect to a postgres database with ODBC and Visual Basic 6.0.
>
> The Postgres ODBC driver is 7.03.xx and it runs with Access, Excel and
> MS-Query without any problems by using a DSN-file.
>
> In VB 6.0 I'm using MS-ADO (ADO 2.7) and the same DSN-file an the
> following error occurs:
>
> "The provider can not be found! Perhaps it is not installed correctly."
>
> Why it is running with Excel and Access? I think it's because Access and
> Excel/MS-Query uses DAO and not ADO?!
>
> Can anybody tell me, how to use MS-ADO and Postgres ODBC? Whats wrong?

Steffen,

Can you give us some sample source code showing everything you are doing
up to the point where it fails (sounds like it is failing on the ADO
open method)?

As far as DAO vs. ADO regarding ODBC for PG - I have had the best luck
using ADO vs DAO. When I was using DAO, I kept running into problems
with regards to TEXT fields (which I had converted from my Access DB
Memo fields). Switching over to ADO fixed my issues. So, I would stick
with ADO.

Andrew Ayers
Phoenix, Arizona

-- CONFIDENTIALITY NOTICE --

This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain
informationthat is privileged, confidential and exempt from disclosure under applicable law. If you are not the
intendedaddressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use,
copy,disclose or distribute to anyone the message or any information contained in the message. If you have received
thismessage in error, please immediately advise the sender by reply email, and delete the message. Thank you.