Spotnick
October 8th, 2002, 01:30 PM
It might not be the best way to navigate through a recordset, but is there an actual way to do the following code better?
private void button1_Click(object sender, System.EventArgs e)
{
ADODB.Connection objConnection = new ADODB.ConnectionClass();
ADODB.Recordset rsData = new ADODB.RecordsetClass();
objConnection.Open("Provider=SQLOLEDB;User ID=daing;Password=daing;Initial Catalog=D42DAIng;Data Source=HERCULES", "daing", "daing", 0);
rsData.Open("select * from t016_achat", objConnection, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockReadOnly, 1);
while (!rsData.EOF)
{
MessageBox.Show(rsData.Fields["CleUniqueA"].Value.ToString());
rsData.MoveNext();
}
}
Funny, I found no information at all on the RecordsetClass, so I guess this is not the way to proceed!!
private void button1_Click(object sender, System.EventArgs e)
{
ADODB.Connection objConnection = new ADODB.ConnectionClass();
ADODB.Recordset rsData = new ADODB.RecordsetClass();
objConnection.Open("Provider=SQLOLEDB;User ID=daing;Password=daing;Initial Catalog=D42DAIng;Data Source=HERCULES", "daing", "daing", 0);
rsData.Open("select * from t016_achat", objConnection, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockReadOnly, 1);
while (!rsData.EOF)
{
MessageBox.Show(rsData.Fields["CleUniqueA"].Value.ToString());
rsData.MoveNext();
}
}
Funny, I found no information at all on the RecordsetClass, so I guess this is not the way to proceed!!