It's all done from the VB.NET side, rather than the Access side, so you
might get more help in a VB.NET newsgroup. To get you started, though, you
need to use ADO.NET with the Microsoft.Jet.OLEDB.4.0 data provider. Here's
an example from a current project. This is C#, but the differences are
minor.
public static System.String[] GetClasses(System.String strOrganisationCode)
{
System.Data.OleDb.OleDbConnection objConnection = new
System.Data.OleDb.OleDbConnection();
try
{
System.Int32 intClassCount = CountClasses(strOrganisationCode);
System.String[] astrClass = new System.String[intClassCount];
objConnection.ConnectionString = GetConnectionString();
System.Data.OleDb.OleDbCommand objCommand =
objConnection.CreateCommand();
objCommand.CommandText = @"qryGetClasses";
objCommand.CommandType = System.Data.CommandType.StoredProcedure;
System.Data.OleDb.OleDbParameter objParameter =
objCommand.CreateParameter();
objParameter.ParameterName = @"[TheOrganisation]";
objParameter.Value = strOrganisationCode;
objCommand.Parameters.Add(objParameter);
objConnection.Open();
System.Data.OleDb.OleDbDataReader objReader =
objCommand.ExecuteReader();
System.Int32 i = 0;
While (objReader.Read())
{
astrClass = objReader.GetString(0);
i++;
}
objReader.Close();
objConnection.Close();
return astrClass;
}
finally
{
objConnection.Dispose();
}
}