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

From DI Hasenöhrl
Subject Re: Difference between ODBCdirect Connection and Pass-through-query
Date
Msg-id 007f01c1d674$20355100$01011eac@irina
Whole thread Raw
In response to Re: Difference between ODBCdirect Connection and Pass-through-query  (Cedar Cox <cedarc@visionforisrael.com>)
List pgsql-odbc
Hi Cedar,
 
Thanks for your response.
 
I didn't find out, how to make it work with recordsets, I can do it only with a query ;-)
 
Me.Recordsource=rst     doesn't work
 
maybe someone else knows what I have to do, in order to work with a recordset
 
Kind regards,
Irina
----- Original Message -----
From: Cedar Cox
Sent: Thursday, March 28, 2002 5:54 PM
Subject: Re: [ODBC] Difference between ODBCdirect Connection and Pass-through-query


> 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: Cedar Cox
Date:
Subject: Re: Difference between ODBCdirect Connection and Pass-through-query
Next
From: Kristis Makris
Date:
Subject: 'infinity'::timestamp not translated correctly using ODBC v7.01.00.10 ?