From: George Weaver <gweaver@shaw.ca>
To: Nasir Mahmood <nasirsol@hotmail.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: Help; if possible
Date: Tue, 17 Nov 2020 13:17:58 -0600
Message-ID: <cf171de1-ba0d-9b9a-f4d1-6714640c09eb@cleartagsoftware.com> (raw)
In-Reply-To: <SG2PR04MB3077E0B4428AE96365142D8ED8E20@SG2PR04MB3077.apcprd04.prod.outlook.com>
References: <SG2PR04MB3077E0B4428AE96365142D8ED8E20@SG2PR04MB3077.apcprd04.prod.outlook.com>
On 17/11/2020 12:29 p.m., Nasir Mahmood wrote:
> Dear Sirs,
>
> I want to access postgreSQL Database from VB2013
>
> I installed the following
>
> PSQLODBC.DLL - A library to talk to the PostgreSQL DBMS using ODBC.
> Copyright (C) 1998 Insight Distribution Systems
> Copyright (C) 1998 - 2020 The PostgreSQL Global Development Group
> Multibyte support was added by Sankyo Unyu Service, (C) 2001.
>
> Now, my following code giving error; which I can't understand what to do
>
> ************
> Dim MyCon As New System.Data.Odbc.OdbcConnection
You've declared MyCon...
> MyCon.ConnectionString = "Driver={PostgreSQL
> ANSI};database=database_name;server=127.0.0.1;port=5432;uid=postgres;sslmode=disable;readonly=0;protocol=7.4;User
> ID=postgres;password=password;"
>
> MyCon.Open()
> If *mCon*.State = ConnectionState.Open Then
but it looks like you used mCon.State, not MyCon.State.
George
> MsgBox("Connected To PostGres",
> MsgBoxStyle.MsgBoxSetForeground)
> End If
>
>
> The above mCon giving following error
> ************
>
> mCon not declared; please guide,
>
> or any example, how to access postgre sql from vb2013 or VB
>
> Regards
>
> Nasir Mahmood
> Lahore - Pakistan
>
--
Cleartag Software, Inc.
972 McMillan Avenue
Winnipeg, MB
R3M 0V7
(204) 284-9839 phone/cell
(204) 284-9838 fax
gweaver@cleartagsoftware.com
Fast. Accurate. Easy.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: gweaver@shaw.ca, nasirsol@hotmail.com
Subject: Re: Help; if possible
In-Reply-To: <cf171de1-ba0d-9b9a-f4d1-6714640c09eb@cleartagsoftware.com>
References: <SG2PR04MB3077E0B4428AE96365142D8ED8E20@SG2PR04MB3077.apcprd04.prod.outlook.com> <cf171de1-ba0d-9b9a-f4d1-6714640c09eb@cleartagsoftware.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox