> 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