RE: [INTERFACES] working with ODBC driver

From: Michael J Davis <michael(dot)j(dot)davis(at)tvguide(dot)com>
To: "'Herbert Ambos'" <herbert(at)tuba(dot)msuiit(dot)edu(dot)ph>, Robert Carbonari <robertC(at)opmr(dot)com>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: RE: [INTERFACES] working with ODBC driver
Date: 1999-06-03 14:55:13
Message-ID: 93C04F1F5173D211A27900105AA8FCFC145558@lambic.prevuenet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Here is a function written in Access (VB) that will execute a vacuum. This
should also show you how to execute other Postgres commands or functions you
have created in Postgres: All you need to do is change "vacuum" to anything
you 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
Set gConODBC = 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 = Nothing
End Sub

-----Original Message-----
From: Herbert Ambos [SMTP:herbert(at)tuba(dot)msuiit(dot)edu(dot)ph]
Sent: Thursday, June 03, 1999 6:59 PM
To: Robert Carbonari
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] working with 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) just
to
manipulate (add/delete/vacuum/create...) the database at the back
end
server. I tried to searc the net about this but i didn't got the
info.
Thanks in advance.

Herbert Ambos
Iligan City, Philippines

>
> Hi,
>
> I'm using VBscript and ADO on my station to manipulate , via the
ODBC
> driver, a table on Postgres which is sitting in a Linux server.
> I can Read information from the table (which I entered manually
through
> PgAdmin), but I can't add new rows to the table through the
script. The
> script abends after trying to execute the (ADO) AddNew method.
What's
> wrong? Does Postgres not understand this command? Should I use
ODBC
> directly to work with the table?
>
>
> Robert Carbonari
> Programmer
> Optimal Robotics Corp.
> e-mail: robertc(at)optimal-robotics(dot)com
> phone: (514)738-8885 ext. 146
>
>
>

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael J Davis 1999-06-03 15:12:34 RE: [INTERFACES] working with ODBC driver
Previous Message Nahuel 1999-06-03 13:53:27 Newbie Idiot Question