Re: Difference between ODBCdirect Connection and Pass-through-query - Mailing list pgsql-odbc

From Cedar Cox
Subject Re: Difference between ODBCdirect Connection and Pass-through-query
Date
Msg-id Pine.LNX.4.21.0203281845030.7307-100000@nanu.visionforisrael.com
Whole thread Raw
In response to Difference between ODBCdirect Connection and Pass-through-query  (DI Hasenöhrl <i.hasenoehrl@aon.at>)
Responses 'infinity'::timestamp not translated correctly using ODBC v7.01.00.10 ?
List pgsql-odbc
> This is the code for my ODBCdirect connection:
>     'ODBC Direct herstellen
>     Set odbcWksp = CreateWorkspace("odbcWkspc", "Ina", "Mai123", dbUseODBC)
>     Set odbcConn = odbcWksp.OpenConnection("odbcConn", dbDriverNoPrompt, ,
>                                          "ODBC;DATABASE=WAWI;UID=ina;PWD=mai123;DSN=WAWI;")

Hey.. that looks like something I wrote! :)

>     strSQL = "SELECT artikel.a_nr,artikel.a_bez1,artikel.a_bez2,artikel.kl_ean,artikel.ws_nr,artikel.wg_nr, " & _
>               "vartikellieferantbez.lief_nr,vartikellieferantbez.kl_kurzbez " & _
>               "FROM Artikel " & _
>               "LEFT JOIN vartikellieferantbez ON (artikel.a_nr = vartikellieferantbez.a_nr AND
vartikellieferantbez.f_nr=1) " & _ 
>               "WHERE (((artikel.a_nr)=-1) AND ((artikel.kl_ean)='HARD'));"

What about:

  Dim rst As Recordset
  Set rst = odbcConn.OpenRecordset(strSQL, dbOpenSnapshot, dbExecDirect)

>     Me.RecordSource = qry.SQL

This part I'm not sure about (it's been a long time away from Access).
Can you just set Me.RecordSource = rst ?  If so, forget making a query.
Also, keep in mind that this would give you a snapshot recordset.  Change
the args to OpenRecordset as necessary.

-Cedar



pgsql-odbc by date:

Previous
From: DI Hasenöhrl
Date:
Subject: Difference between ODBCdirect Connection and Pass-through-query
Next
From: DI Hasenöhrl
Date:
Subject: Re: Difference between ODBCdirect Connection and Pass-through-query