This is a multi-part message in MIME format.

------=_NextPart_000_0203_01C61032.6F29FDF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,

I am facing a weird problem using the DataReader.

This is what my code looks like.

---------------
Dim dbCommand As OleDbCommand
Dim dReader As OleDbDataReader
dbCommand =3D New OleDbCommand("SELECT * FROM CmpDet where =
cmpDet_CompanyID =3D " & CurrentCompany.CompanyID, DBCompany)
dReader =3D dbCommand.ExecuteReader 'Retrieve info from the database
dReader.Read() 'Read the record

'Load the company details
Try
CurrentCompany.Address =3D dReader.Item("cmpDet_MailAddress")
CurrentCompany.CompanyName =3D dReader.Item("cmpDet_CompanyName")
CurrentCompany.City =3D dReader.Item("cmpDet_CityName")
CurrentCompany.State =3D dReader.Item("cmpDet_State")
Catch ex As Exception
MsgBox(ex.Message)
Stop
End Try

'Empty the objects

dReader.Close()
dbCommand.Dispose()
dReader =3D Nothing
dbCommand =3D Nothing

---------------------

My problem is that on the dReader.item("cmpDet_MailAddress") line (When =
I try to read the contents of the dReader object). I sometimes get an =
error 'Invalid Row Handler'=20

This error does not occur all of the time, only some of it. Could it be =
because the records that the dReader retrieves were added to the db in a =
line just above this code block? I am using a dbCommand object with an =
"INSERT INTO" query to add the contents to the DB so I expect that there =
should be no problems retrieving data.

This error only occurs some of the time, and at other times it runs =
fine.

Any clues why this could be happening?

Thanks
Cyril Gupta

------=_NextPart_000_0203_01C61032.6F29FDF0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DVerdana size=3D2>Hello,</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>I am facing a weird problem using the =

DataReader.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>This is what my code looks =
like.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>---------------<BR></FONT><FONT =
face=3DVerdana=20
size=3D2>Dim dbCommand As OleDbCommand<BR>Dim dReader As=20
OleDbDataReader</FONT></DIV>
<DIV>
<P><FONT face=3DVerdana size=3D2>dbCommand =3D New OleDbCommand("SELECT =
* FROM CmpDet=20
where cmpDet_CompanyID =3D " &amp; CurrentCompany.CompanyID, =
DBCompany)<BR>dReader=20
=3D dbCommand.ExecuteReader 'Retrieve info from the =
database<BR>dReader.Read()=20
'Read the record</FONT></P>
<P><FONT face=3DVerdana size=3D2>'Load the company=20
details<BR>Try<BR>&nbsp;CurrentCompany.Address =3D=20
dReader.Item("cmpDet_MailAddress")<BR>&nbsp;CurrentCompany.CompanyName =
=3D=20
dReader.Item("cmpDet_CompanyName")<BR>&nbsp;CurrentCompany.City =3D=20
dReader.Item("cmpDet_CityName")<BR>&nbsp;CurrentCompany.State =3D=20
dReader.Item("cmpDet_State")<BR>Catch ex As=20
Exception<BR>&nbsp;MsgBox(ex.Message)<BR>&nbsp;Stop<BR>End =
Try</FONT></P>
<P><FONT face=3DVerdana size=3D2>'Empty the objects</FONT></P>
<P><FONT face=3DVerdana =
size=3D2>dReader.Close()<BR>dbCommand.Dispose()<BR>dReader =3D=20
Nothing<BR>dbCommand =3D Nothing</FONT></P>
<P><FONT size=3D2><FONT =
face=3DVerdana>---------------------</FONT></FONT></P>
<P><FONT face=3DVerdana size=3D2>My problem is that on the=20
dReader.item("cmpDet_MailAddress") line (When I try to read the contents =
of the=20
dReader object). I sometimes get an error 'Invalid Row Handler' =
</FONT></P>
<P><FONT face=3DVerdana size=3D2>This error does not occur all of the =
time, only=20
some of it. Could it be because the records that the dReader retrieves =
were=20
added to the db in a line just above this code block? I am using a =
dbCommand=20
object with an "INSERT INTO" query to add the contents to the DB so I =
expect=20
that there should be no problems retrieving data.</FONT></P>
<P><FONT face=3DVerdana size=3D2>This error only occurs some of the =
time, and at=20
other times it runs fine.</FONT></P>
<P><FONT face=3DVerdana size=3D2>Any clues why this could be =
happening?</FONT></P>
<P><FONT face=3DVerdana size=3D2>Thanks<BR>Cyril=20
Gupta</FONT></P></DIV></BODY></HTML>

------=_NextPart_000_0203_01C61032.6F29FDF0--

Re: Random 'Invalid Row Handle' by William

William
Mon Jan 02 21:20:31 CST 2006

This is a multi-part message in MIME format.

------=_NextPart_000_0014_01C60FD1.99126960
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I would suspect your data provider. It's either JET or some other OLE DB =
data source which are notorious for lazy writes.

--=20
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no =
rights.
__________________________________

"Cyril Gupta" <nomail@mail.com> wrote in message =
news:Obr0$RAEGHA.3892@TK2MSFTNGP10.phx.gbl...
Hello,

I am facing a weird problem using the DataReader.

This is what my code looks like.

---------------
Dim dbCommand As OleDbCommand
Dim dReader As OleDbDataReader
dbCommand =3D New OleDbCommand("SELECT * FROM CmpDet where =
cmpDet_CompanyID =3D " & CurrentCompany.CompanyID, DBCompany)
dReader =3D dbCommand.ExecuteReader 'Retrieve info from the database
dReader.Read() 'Read the record

'Load the company details
Try
CurrentCompany.Address =3D dReader.Item("cmpDet_MailAddress")
CurrentCompany.CompanyName =3D dReader.Item("cmpDet_CompanyName")
CurrentCompany.City =3D dReader.Item("cmpDet_CityName")
CurrentCompany.State =3D dReader.Item("cmpDet_State")
Catch ex As Exception
MsgBox(ex.Message)
Stop
End Try

'Empty the objects

dReader.Close()
dbCommand.Dispose()
dReader =3D Nothing
dbCommand =3D Nothing

---------------------

My problem is that on the dReader.item("cmpDet_MailAddress") line =
(When I try to read the contents of the dReader object). I sometimes get =
an error 'Invalid Row Handler'=20

This error does not occur all of the time, only some of it. Could it =
be because the records that the dReader retrieves were added to the db =
in a line just above this code block? I am using a dbCommand object with =
an "INSERT INTO" query to add the contents to the DB so I expect that =
there should be no problems retrieving data.

This error only occurs some of the time, and at other times it runs =
fine.

Any clues why this could be happening?

Thanks
Cyril Gupta

------=_NextPart_000_0014_01C60FD1.99126960
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"Comic Sans MS" color=3D#0000ff size=3D2>I would =
suspect your data=20
provider. It's either JET or some other OLE DB data source which are =
notorious=20
for lazy writes.</FONT></DIV>
<DIV><BR>-- <BR>____________________________________<BR>William (Bill)=20
Vaughn<BR>Author, Mentor, Consultant<BR>Microsoft MVP<BR>INETA =
Speaker<BR><A=20
href=3D"http://www.betav.com/blog/billva">www.betav.com/blog/billva</A><B=
R><A=20
href=3D"http://www.betav.com">www.betav.com</A><BR>Please reply only to =
the=20
newsgroup so that others can benefit.<BR>This posting is provided "AS =
IS" with=20
no warranties, and confers no=20
rights.<BR>__________________________________<BR></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Cyril Gupta" &lt;<A=20
href=3D"mailto:nomail@mail.com">nomail@mail.com</A>&gt; wrote in =
message <A=20
=
href=3D"news:Obr0$RAEGHA.3892@TK2MSFTNGP10.phx.gbl">news:Obr0$RAEGHA.3892=
@TK2MSFTNGP10.phx.gbl</A>...</DIV>
<DIV><FONT face=3DVerdana size=3D2>Hello,</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>I am facing a weird problem using =
the=20
DataReader.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>This is what my code looks =
like.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>---------------<BR></FONT><FONT =
face=3DVerdana=20
size=3D2>Dim dbCommand As OleDbCommand<BR>Dim dReader As=20
OleDbDataReader</FONT></DIV>
<DIV>
<P><FONT face=3DVerdana size=3D2>dbCommand =3D New =
OleDbCommand("SELECT * FROM=20
CmpDet where cmpDet_CompanyID =3D " &amp; CurrentCompany.CompanyID,=20
DBCompany)<BR>dReader =3D dbCommand.ExecuteReader 'Retrieve info from =
the=20
database<BR>dReader.Read() 'Read the record</FONT></P>
<P><FONT face=3DVerdana size=3D2>'Load the company=20
details<BR>Try<BR>&nbsp;CurrentCompany.Address =3D=20
dReader.Item("cmpDet_MailAddress")<BR>&nbsp;CurrentCompany.CompanyName =
=3D=20
dReader.Item("cmpDet_CompanyName")<BR>&nbsp;CurrentCompany.City =3D=20
dReader.Item("cmpDet_CityName")<BR>&nbsp;CurrentCompany.State =3D=20
dReader.Item("cmpDet_State")<BR>Catch ex As=20
Exception<BR>&nbsp;MsgBox(ex.Message)<BR>&nbsp;Stop<BR>End =
Try</FONT></P>
<P><FONT face=3DVerdana size=3D2>'Empty the objects</FONT></P>
<P><FONT face=3DVerdana =
size=3D2>dReader.Close()<BR>dbCommand.Dispose()<BR>dReader=20
=3D Nothing<BR>dbCommand =3D Nothing</FONT></P>
<P><FONT size=3D2><FONT =
face=3DVerdana>---------------------</FONT></FONT></P>
<P><FONT face=3DVerdana size=3D2>My problem is that on the=20
dReader.item("cmpDet_MailAddress") line (When I try to read the =
contents of=20
the dReader object). I sometimes get an error 'Invalid Row Handler'=20
</FONT></P>
<P><FONT face=3DVerdana size=3D2>This error does not occur all of the =
time, only=20
some of it. Could it be because the records that the dReader retrieves =
were=20
added to the db in a line just above this code block? I am using a =
dbCommand=20
object with an "INSERT INTO" query to add the contents to the DB so I =
expect=20
that there should be no problems retrieving data.</FONT></P>
<P><FONT face=3DVerdana size=3D2>This error only occurs some of the =
time, and at=20
other times it runs fine.</FONT></P>
<P><FONT face=3DVerdana size=3D2>Any clues why this could be =
happening?</FONT></P>
<P><FONT face=3DVerdana size=3D2>Thanks<BR>Cyril=20
Gupta</FONT></P></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0014_01C60FD1.99126960--


Re: Random 'Invalid Row Handle' by Cyril

Cyril
Tue Jan 03 09:46:39 CST 2006

This is a multi-part message in MIME format.

------=_NextPart_000_00E8_01C610AA.FC6351D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello Bill,

I think you've got a breakthrough right there. Yep my data provider is =
Jet. Any ideas on how I can make sure the data is updated before I do =
the retrieval operation?=20

Thanks for that keyword 'lazy write' I will try to do google on it and =
see if any one else has had the problem.

Thanks
Cyril
------=_NextPart_000_00E8_01C610AA.FC6351D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DVerdana size=3D2>Hello Bill,</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>I think you've got a breakthrough =
right there.=20
Yep my data provider is Jet. Any ideas on how I can make sure the data =
is=20
updated before I do the retrieval operation? <BR></FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>Thanks for that keyword 'lazy write' =
I will try=20
to do google on it and see if any one else has had the =
problem.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana><FONT size=3D1>Thanks</FONT></FONT></DIV>
<DIV><FONT face=3DVerdana><FONT size=3D1>Cyril</FONT><FONT=20
size=3D2></DIV></FONT></FONT></BODY></HTML>

------=_NextPart_000_00E8_01C610AA.FC6351D0--


Re: Random 'Invalid Row Handle' by William

William
Tue Jan 03 13:26:39 CST 2006

This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C61058.9050AAD0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

There are a couple of ways, but the easiest is to perform updates in a =
transaction.

--=20
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no =
rights.
__________________________________

"Cyril Gupta" <nomail@mail.com> wrote in message =
news:OJ3aYzHEGHA.3920@tk2msftngp13.phx.gbl...
Hello Bill,

I think you've got a breakthrough right there. Yep my data provider is =
Jet. Any ideas on how I can make sure the data is updated before I do =
the retrieval operation?=20

Thanks for that keyword 'lazy write' I will try to do google on it and =
see if any one else has had the problem.

Thanks
Cyril
------=_NextPart_000_000B_01C61058.9050AAD0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"Comic Sans MS" color=3D#0000ff size=3D2>There are a =
couple of ways,=20
but the easiest is to perform updates in a transaction.</FONT></DIV>
<DIV><BR>-- <BR>____________________________________<BR>William (Bill)=20
Vaughn<BR>Author, Mentor, Consultant<BR>Microsoft MVP<BR>INETA =
Speaker<BR><A=20
href=3D"http://www.betav.com/blog/billva">www.betav.com/blog/billva</A><B=
R><A=20
href=3D"http://www.betav.com">www.betav.com</A><BR>Please reply only to =
the=20
newsgroup so that others can benefit.<BR>This posting is provided "AS =
IS" with=20
no warranties, and confers no=20
rights.<BR>__________________________________<BR></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Cyril Gupta" &lt;<A=20
href=3D"mailto:nomail@mail.com">nomail@mail.com</A>&gt; wrote in =
message <A=20
=
href=3D"news:OJ3aYzHEGHA.3920@tk2msftngp13.phx.gbl">news:OJ3aYzHEGHA.3920=
@tk2msftngp13.phx.gbl</A>...</DIV>
<DIV><FONT face=3DVerdana size=3D2>Hello Bill,</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>I think you've got a breakthrough =
right there.=20
Yep my data provider is Jet. Any ideas on how I can make sure the data =
is=20
updated before I do the retrieval operation? <BR></FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>Thanks for that keyword 'lazy =
write' I will try=20
to do google on it and see if any one else has had the =
problem.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana><FONT size=3D1>Thanks</FONT></FONT></DIV>
<DIV><FONT face=3DVerdana><FONT size=3D1>Cyril</FONT><FONT=20
size=3D2></DIV></BLOCKQUOTE></FONT></FONT></BODY></HTML>

------=_NextPart_000_000B_01C61058.9050AAD0--


Re: Random 'Invalid Row Handle' by Cyril

Cyril
Tue Jan 03 20:55:44 CST 2006

This is a multi-part message in MIME format.

------=_NextPart_000_0012_01C61108.74B64270
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello Bill!

Thanks for that tip about updating using Transactions, it worked =
wonderfully. I also found out that this problem occurs with ADO too, but =
there's an easy worked using the Jet Access & Replication Objects (JRO). =


Thanks for the help!=20

Cheers!

We all get by with a little help from friends. :)
------=_NextPart_000_0012_01C61108.74B64270
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DVerdana size=3D2>Hello Bill!</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Thanks for that tip about updating =
using=20
Transactions, it worked wonderfully. I also found out that this problem =
occurs=20
with ADO too, but there's an easy worked using the Jet Access &amp; =
Replication=20
Objects (JRO). </FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Thanks for the help! </FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Cheers!</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>We all get by with a little help from =
friends.=20
:)</FONT></DIV></BODY></HTML>

------=_NextPart_000_0012_01C61108.74B64270--