Best method of access to PostgreSql using VBA in Microsoft Access

From: "David Pinelo" <adpinelo(at)yahoo(dot)es>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: Best method of access to PostgreSql using VBA in Microsoft Access
Date: 2002-01-29 21:41:13
Message-ID: 002001c1a90d$b026db10$0609d8d9@ender
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi!

I'm using Access like front-end to a PostgreSQL server with ODBC... I
make a lot of select queries with visual basic code along the aplication.
What are the best access method to obtain best perfomance? Yo know, shall I
use ODBCDirect? ADO? DAO, maybe?

For example, I have to make a select like this: "SELECT * FROM table1
WHERE id=[Forms]![Form1]!id AND aaa=value_I_obtain_in_my_vb_code", what's
the better methdo of this one?

--------------------------
Dim queryd as Querydef
Dim rst as Recordset

set queryd=cnData.CreateQueryDef("") 'cnData is a Connection to ODBC
source
queryd.SQL="SELECT ..."
set rst=queryd.OpenRecordset(dbOpenSnapshot)
----------------------------

or

Dim dbs as Database
Dim rst as Recordset

set dbs=CurrentDb()
set rst=dbs.OpenRecordset("SELECT ...")
-----------------------------------------------

And, if I want to update a record, what's the best?

this one?

rst.Edit
rst![field]=value
rst.update

or

Dim queryd as QueryDef
set queryd=cnData.CreateQueryDef("")
queryd.SQL="UPDATE..."
queryd.Execute

I have all the tables that I need, linked to mdb file.

Thank you very much

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Browse pgsql-interfaces by date

  From Date Subject
Next Message isaac flemmin 2002-01-30 00:53:07 libpq++ compiling errors...
Previous Message Yoghini Thevarajah 2002-01-29 17:23:27 Help in configuring JDBC driver