RE: [INTERFACES] working with ODBC driver - Mailing list pgsql-interfaces

From Michael J Davis
Subject RE: [INTERFACES] working with ODBC driver
Date
Msg-id 93C04F1F5173D211A27900105AA8FCFC14555A@lambic.prevuenet.com
Whole thread Raw
List pgsql-interfaces
BTW, this assumes that the name of your ODBC data source is "PostgreSQL".
You may need to change "PostgreSQL" to the name of your ODBC data source for
your PostgreSQL database.  Also, I use a trusted connection so no password
is required.  You can hard code a user name and password rather than using
the user name of the current user (this script shows you how to get the
current connected user).  I would recommend hard coding the user name if you
are NOT using Access97 security.
-----Original Message-----From:    Michael J Davis Sent:    Thursday, June 03, 1999 8:55 AMTo:    'Herbert Ambos';
RobertCarbonariCc:    pgsql-interfaces@postgreSQL.orgSubject:    RE: [INTERFACES] working with ODBC driver
 
Here is a function written in Access (VB) that will execute a
vacuum.  Thisshould also show you how to execute other Postgres commands or
functions youhave created in Postgres:  All you need to do is change "vacuum" to
anythingyou want to call in Postgres.
Public Sub si_vacuum()   Dim wrk As Workspace   Dim usrname As String   Set wrk = DBEngine.Workspaces(0)   usrname =
wrk.UserName  Set gWrkODBC = CreateWorkspace("ODBCWorkspace", "postgres", "",dbUseODBC)   Workspaces.Append gWrkODBC
SetgConODBC = gWrkODBC.OpenConnection("SI_ODBC", , False,"ODBC;DSN=PostgreSQL;UID=" & usrname & ";PWD=;")
gConODBC.Execute"vacuum;"      gConODBC.Close   gWrkODBC.Close   Set gWrkODBC = Nothing   Set gConODBC = Nothing   Set
wrk= NothingEnd Sub
 


    -----Original Message-----    From:    Herbert Ambos [SMTP:herbert@tuba.msuiit.edu.ph]    Sent:    Thursday, June
03,1999 6:59 PM    To:    Robert Carbonari    Cc:    pgsql-interfaces@postgreSQL.org    Subject:    Re: [INTERFACES]
workingwith ODBC driver
 

    i had the same problem, but i use MS Access 97 as an
interface.Could    somebody tell us on what procedures to embark (or
script/code) justto    manipulate (add/delete/vacuum/create...) the database at the
backend    server.  I tried to searc the net about this but i didn't
got theinfo.    Thanks in advance.
    Herbert Ambos    Iligan City, Philippines
    >     > Hi,    >     > I'm using VBscript and ADO on my station to manipulate ,
via theODBC    > driver, a table on Postgres which is sitting in a Linux
server.      > I can Read information from the table (which I entered
manuallythrough    > PgAdmin), but I can't add new rows to the table through
thescript.  The    > script abends after trying to execute the (ADO) AddNew
method.What's    > wrong?  Does Postgres not understand this command?  Should
I useODBC    > directly to work with the table?      >     >     > Robert Carbonari    > Programmer    > Optimal
RoboticsCorp.    > e-mail: robertc@optimal-robotics.com    > phone:  (514)738-8885 ext. 146    >     >     >     
 


pgsql-interfaces by date:

Previous
From: Michael J Davis
Date:
Subject: RE: [INTERFACES] working with ODBC driver
Next
From: "Brent Waldrop"
Date:
Subject: libpgtcl.so