Hi all ,
I wonder if you can help I run this code once

Dim daEmpDet2 As OleDbDataAdapter defined globally

strSQL1 = "select * From PREmpDet where Empcode='" & EmpCode & "'"
Dim dsEmpDet2 = New OleDbDataAdapter(strSQL1, cn2)
daEmpDet2.Fill(dsEmpDet2, "EmpDet2")

I get the right record when run the code the first time .
when I rerun the code with a different EmpCode I Still get the first record
what am I doing WRONG.
Thanks

Re: requerying with Dataadapter and dataset by Miha

Miha
Fri Nov 21 14:38:07 CST 2003

Hi,

You should clear the dataset before doing fill (fill just adds rows)

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com

<CobraStrikes@al.com> wrote in message
news:bpln9t$avd$1@news7.svr.pol.co.uk...
>
> Hi all ,
> I wonder if you can help I run this code once
>
> Dim daEmpDet2 As OleDbDataAdapter defined globally
>
> strSQL1 = "select * From PREmpDet where Empcode='" & EmpCode & "'"
> Dim dsEmpDet2 = New OleDbDataAdapter(strSQL1, cn2)
> daEmpDet2.Fill(dsEmpDet2, "EmpDet2")
>
> I get the right record when run the code the first time .
> when I rerun the code with a different EmpCode I Still get the
first record
> what am I doing WRONG.
> Thanks
>
>