Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

[ENGLISH] query from access to msde

1 réponse
Avatar
PiantoTardivo
First of all....sorry for writing in english.
I'm trying to pass from access to msde.
I have a query that returns some values to populate a listview.
With access this query works in the right way, but in msde I have some
problems .
That's the query
rs.Open "select * from anagp inner join ingrp on anagp.incr = ingrp.rif
where ingrp.lotto='" & ListView2.SelectedItem.SubItems(1) & "' order by
anagp.data desc", cn, adOpenStatic, adLockOptimistic

I've checked out in the immediate window that the query works well but when
I populate the LW I have this problem

li.SubItems(2) = "" & rs("anagp.nome").Value

where li has the dimension of a listitem...

Error: cannot find anag.nome

Why????

Any suggestion will be very apprecitated

Thanx

IAK

1 réponse

Avatar
hch
Hello i think that you made a mistake in the code

li.SubItems(2) = "" & rs("anagp.nome").Value

you should replace rs("anagp.nome") by rs("nome") because the correct syntax
for manipulating recordsets is

rs("field").values and not rs("table.field").value

hch




"PiantoTardivo" a écrit :

First of all....sorry for writing in english.
I'm trying to pass from access to msde.
I have a query that returns some values to populate a listview.
With access this query works in the right way, but in msde I have some
problems .
That's the query
rs.Open "select * from anagp inner join ingrp on anagp.incr = ingrp.rif
where ingrp.lotto='" & ListView2.SelectedItem.SubItems(1) & "' order by
anagp.data desc", cn, adOpenStatic, adLockOptimistic

I've checked out in the immediate window that the query works well but when
I populate the LW I have this problem

li.SubItems(2) = "" & rs("anagp.nome").Value

where li has the dimension of a listitem...

Error: cannot find anag.nome

Why????

Any suggestion will be very apprecitated

Thanx

IAK