Yan Zang
1/21/2003 9:00:00 PM
Hi,
I am trying to use .Net ODBC to read data from a legacy ODBC data store. The
legacy ODBC driver works OK when I access it using classic ASP. When I use
.Net, the connection and dataReader are opened, but I got the following
error at the line when the data is read
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in
microsoft.data.odbc.dll
Additional information: NAME
The code is attached. Any ideas? Thanks!
Yan
----------------------------------------------------------------------------
---------
mstrSQL_in = "SELECT * from CLIENTS where CODE='1006'"
mobjBuilder_in = New OdbcCommand(mstrSQL_in, mobjConnection_in)
mobjDataReader_in = mobjBuilder_in.ExecuteReader()
MsgBox("reader opened")
While (mobjDataReader_in.Read() = True)
Name = mobjDataReader_in("NAME") ************** error line
****************
end while