pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
VB and ODBC
5+ messages / 4 participants
[nested] [flat]

* VB and ODBC
@ 1998-04-27 09:55  Sbragion Denis <infotecn@tin.it>
  0 siblings, 0 replies; 5+ messages in thread

From: Sbragion Denis @ 1998-04-27 09:55 UTC (permalink / raw)
  To: pgsql-interfaces

Hello,

I have to revert my previous statement about a reference in the VB help
about the unique index problem. The reference was in the help of another
ODBC driver (the one supplied with the Solid RDMS) that I'm no longer
using. Anyway I'm pretty sure Solid was reporting this as a VB limitation,
not as a limitation of their own driver. I'll do some some deeper
investigation (aargh, I think I'll have to took a look in the Microsoft KB).

Bye !

	Dr. Sbragion Denis
	InfoTecna
	Tel, Fax: +39 39 2324054
	URL: http://space.tin.it/internet/dsbragio



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* VB and ODBC
@ 2001-04-27 11:17  Graham Vickrage <graham@digitalplanit.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Graham Vickrage @ 2001-04-27 11:17 UTC (permalink / raw)
  To: pgsql-interfaces

I am a new to ODBC and relatively new to VB. I am trying to make a
connection to a postgres 7.0 DB from word via a VB macro. I think I have
installed the ODBC driver correctly (win98) and am trying to make a
connection via the VB module using the following.

Sub ClientOrder()
    With ActiveDocument.MailMerge
        .MainDocumentType = wdFormLetters
        constr = "DSN=PostgreSQL;" _
                 & "FIL=RedISAM;"
       .OpenDataSource Name:="dbname", _
       Connection:=constr, SQLStatement:="SELECT Client_order_id FROM
client_order"
    End With
End Sub

This does not work I think because of the .OpenDataSource Name:="dbname". In
other examples (ie access) it points directly the the DB File ie
'c:/somefile.mdb'. How would this work for postgres, is there an equivilant
on the linux box (I think not). Or could someone point me to some examples
of this.

Thanks in advance

Graham




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* RE: VB and ODBC
@ 2001-04-27 15:05  Michael Ansley (UK) <Michael.Ansley@intec-telecom-systems.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Michael Ansley (UK) @ 2001-04-27 15:05 UTC (permalink / raw)
  To: 'Graham Vickrage' <graham@digitalplanit.com>; pgsql-interfaces

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When using Access, because it is essentially a file-based db, rather
than server-based, you give the filename.  With Postgres, you will
probably not have to give the data source a name, but you will have
to change the parameters in the connection string.  I think that the
Name parameter is used to give the connection a name internal to the
script that you're running.  It's only a temporary thing.  The
connection string should probably be something like:

constr = "ODBC;DSN=Your_DSN;UID=user;PWD=password"

Your_DSN needs to be a DSN that you have already defined in the
control panel, user needs to be the database user, and password for
the password, if it's required.  You may also get away with this:

constr =
"ODBC;Driver={PostgreSQL};SERVER=Your_Server;DATABASE=Your_Database;UI
D=user;PWD=password"

which means that you don't have to create the DSN beforehand.  The
DATABASE keyword may not be right, but I can't remember what it is
offhand for Postgres.  Each vendor has it's own set of keywords,
although UID and PWD seem to be pretty universal, and the ODBC prefix
is always required for ODBC connections (remember, DAO doesn't assume
that you want to use ODBC, you have to tell it).  If you feel like
tracing the connection (using the first method), then you can find
out what the keywords are ;-) and use the second.

Cheers...


MikeA




>> -----Original Message-----
>> From: Graham Vickrage [mailto:graham@digitalplanit.com]
>> Sent: 27 April 2001 12:18
>> To: pgsql-interfaces@postgresql.org
>> Subject: [INTERFACES] VB and ODBC
>> 
>> 
>> I am a new to ODBC and relatively new to VB. I am trying to make a
>> connection to a postgres 7.0 DB from word via a VB macro. I 
>> think I have
>> installed the ODBC driver correctly (win98) and am trying to make
>> a connection via the VB module using the following.
>> 
>> Sub ClientOrder()
>>     With ActiveDocument.MailMerge
>>         .MainDocumentType = wdFormLetters
>>         constr = "DSN=PostgreSQL;" _
>>                  & "FIL=RedISAM;"
>>        .OpenDataSource Name:="dbname", _
>>        Connection:=constr, SQLStatement:="SELECT Client_order_id
>> FROM client_order"
>>     End With
>> End Sub
>> 
>> This does not work I think because of the .OpenDataSource 
>> Name:="dbname". In
>> other examples (ie access) it points directly the the DB File ie
>> 'c:/somefile.mdb'. How would this work for postgres, is 
>> there an equivilant
>> on the linux box (I think not). Or could someone point me to 
>> some examples
>> of this.
>> 
>> Thanks in advance
>> 
>> Graham
>> 
>> 
>> ---------------------------(end of 
>> broadcast)---------------------------
>> TIP 3: if posting/reading through Usenet, please send an
>> appropriate subscribe-nomail command to majordomo@postgresql.org
>> so that your message can get through to the mailing list cleanly
>> 

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com;

iQA/AwUBOumJhXympNV/C086EQL99QCg2AAXwiurv69MuAp5Mjqd8xdYGo8AoNx1
cQbDKazTLrPd9hGleKk9b5tV
=hU5o
-----END PGP SIGNATURE-----

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* RE: VB and ODBC
@ 2001-04-27 17:02  Graham Vickrage <graham@digitalplanit.com>
  parent: Michael Ansley (UK) <Michael.Ansley@intec-telecom-systems.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Graham Vickrage @ 2001-04-27 17:02 UTC (permalink / raw)
  To: Michael Ansley (UK) <Michael.Ansley@intec-telecom-systems.com>; pgsql-interfaces

RE: [INTERFACES] VB and ODBCThanks for the advice, but I seem to still be
having probs.

I can't leave out the name param as its required so the only option is to
leave it blank. If I put anything else in its place then it comes back with
an error that the files does not exist.

When I give an empty string as the name there are no errors, so assuming
this is working how do I then extract the data from the dataconnectioin and
print it in the doc?

With perl DBI it might be something like
$query = DBI->connect(etc...) ;
$query->fetchrow();

What it the equivelant for VB?

P.S. I got my client ODBC driver from www.greatbridge.com is there a version
from the postgres site I should be using instead?

A struggling perl programmer trying to write VB.

 -----Original Message-----
From: Michael Ansley (UK) [mailto:Michael.Ansley@intec-telecom-systems.com]
Sent: 27 April 2001 16:05
To: 'Graham Vickrage'; pgsql-interfaces@postgresql.org
Subject: RE: [INTERFACES] VB and ODBC


  -----BEGIN PGP SIGNED MESSAGE-----
  Hash: SHA1

  When using Access, because it is essentially a file-based db, rather
  than server-based, you give the filename.  With Postgres, you will
  probably not have to give the data source a name, but you will have
  to change the parameters in the connection string.  I think that the
  Name parameter is used to give the connection a name internal to the
  script that you're running.  It's only a temporary thing.  The
  connection string should probably be something like:

  constr = "ODBC;DSN=Your_DSN;UID=user;PWD=password"

  Your_DSN needs to be a DSN that you have already defined in the
  control panel, user needs to be the database user, and password for
  the password, if it's required.  You may also get away with this:

  constr =
  "ODBC;Driver={PostgreSQL};SERVER=Your_Server;DATABASE=Your_Database;UI
  D=user;PWD=password"

  which means that you don't have to create the DSN beforehand.  The
  DATABASE keyword may not be right, but I can't remember what it is
  offhand for Postgres.  Each vendor has it's own set of keywords,
  although UID and PWD seem to be pretty universal, and the ODBC prefix
  is always required for ODBC connections (remember, DAO doesn't assume
  that you want to use ODBC, you have to tell it).  If you feel like
  tracing the connection (using the first method), then you can find
  out what the keywords are ;-) and use the second.

  Cheers...



  MikeA





  >> -----Original Message-----
  >> From: Graham Vickrage [mailto:graham@digitalplanit.com]
  >> Sent: 27 April 2001 12:18
  >> To: pgsql-interfaces@postgresql.org
  >> Subject: [INTERFACES] VB and ODBC
  >>
  >>
  >> I am a new to ODBC and relatively new to VB. I am trying to make a
  >> connection to a postgres 7.0 DB from word via a VB macro. I
  >> think I have
  >> installed the ODBC driver correctly (win98) and am trying to make
  >> a connection via the VB module using the following.
  >>
  >> Sub ClientOrder()
  >>     With ActiveDocument.MailMerge
  >>         .MainDocumentType = wdFormLetters
  >>         constr = "DSN=PostgreSQL;" _
  >>                  & "FIL=RedISAM;"
  >>        .OpenDataSource Name:="dbname", _
  >>        Connection:=constr, SQLStatement:="SELECT Client_order_id
  >> FROM client_order"
  >>     End With
  >> End Sub
  >>
  >> This does not work I think because of the .OpenDataSource
  >> Name:="dbname". In
  >> other examples (ie access) it points directly the the DB File ie
  >> 'c:/somefile.mdb'. How would this work for postgres, is
  >> there an equivilant
  >> on the linux box (I think not). Or could someone point me to
  >> some examples
  >> of this.
  >>
  >> Thanks in advance
  >>
  >> Graham
  >>
  >>
  >> ---------------------------(end of
  >> broadcast)---------------------------
  >> TIP 3: if posting/reading through Usenet, please send an
  >> appropriate subscribe-nomail command to majordomo@postgresql.org
  >> so that your message can get through to the mailing list cleanly
  >>

  -----BEGIN PGP SIGNATURE-----
  Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com;

  iQA/AwUBOumJhXympNV/C086EQL99QCg2AAXwiurv69MuAp5Mjqd8xdYGo8AoNx1
  cQbDKazTLrPd9hGleKk9b5tV
  =hU5o
  -----END PGP SIGNATURE-----



  _________________________________________________________________________
  This e-mail and any attachments are confidential and may also be
privileged and/or copyright
  material of Intec Telecom Systems PLC (or its affiliated companies). If
you are not an
  intended or authorised recipient of this e-mail or have received it in
error, please delete
  it immediately and notify the sender by e-mail. In such a case, reading,
reproducing,
  printing or further dissemination of this e-mail is strictly prohibited
and may be unlawful.
  Intec Telecom Systems PLC. does not represent or warrant that an
attachment hereto is free
  from computer viruses or other defects. The opinions expressed in this
e-mail and any
  attachments may be those of the author and are not necessarily those of
Intec Telecom
  Systems PLC.

  This footnote also confirms that this email message has been swept by
  MIMEsweeper for the presence of computer viruses.
  __________________________________________________________________________

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* RE: VB and ODBC
@ 2001-04-27 20:02  Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 5+ messages in thread

From: Dave Page @ 2001-04-27 20:02 UTC (permalink / raw)
  To: 'Graham Vickrage' <graham@digitalplanit.com>; Michael Ansley (UK) <Michael.Ansley@intec-telecom-systems.com>; pgsql-interfaces

 

-----Original Message-----
From: Graham Vickrage [mailto:graham@digitalplanit.com]
Sent: 27 April 2001 18:03
To: Michael Ansley (UK); pgsql-interfaces@postgresql.org
Subject: RE: [INTERFACES] VB and ODBC


Thanks for the advice, but I seem to still be having probs.
 
I can't leave out the name param as its required so the only option is to
leave it blank. If I put anything else in its place then it comes back with
an error that the files does not exist.
 
When I give an empty string as the name there are no errors, so assuming
this is working how do I then extract the data from the dataconnectioin and
print it in the doc?
 
With perl DBI it might be something like 
$query = DBI->connect(etc...) ;
$query->fetchrow();
 
What it the equivelant for VB? 
 

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2001-04-27 20:02 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-04-27 09:55 VB and ODBC Sbragion Denis <infotecn@tin.it>
2001-04-27 11:17 VB and ODBC Graham Vickrage <graham@digitalplanit.com>
2001-04-27 15:05 RE: VB and ODBC Michael Ansley (UK) <Michael.Ansley@intec-telecom-systems.com>
2001-04-27 17:02 ` Graham Vickrage <graham@digitalplanit.com>
2001-04-27 20:02 RE: VB and ODBC Dave Page <dpage@vale-housing.co.uk>

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