C#, dao, optional parameters and Seek method

  • Thread starter Thread starter info
  • Start date Start date
I

info

I need to use DAO in one of my applications. It was too hard to pass
through by optional parameters for several methods, but now I'm totally
lost at DAO seek method (the main method for key s).
The method has a next declaration:

Sub Seek(Comparison As String, Key1, [Key2], [Key3], [Key4], [Key5],
[Key6], [Key7], [Key8], [Key9], [Key10], [Key11], [Key12], [Key13])
Member of DAO.Recordset

12 optional parameters. I tried anything for the Key2-Key13, without
success - Null, System.Guid.Empty, System.TypeCode.DBNull, ... But
without success. The Seek method always returns:

"Additional information: Could not build key."

What can I do with the method?

My code looks like:

DAO.Database db = CreateDatabase("test.mdb");

DAO.Recordset A =
db.OpenRecordset("A",DAO.RecordsetTypeEnum.dbOpenTable,0,
DAO.LockTypeEnum.dbOptimistic);
A.Index="PrimaryKey";

for (int i=1; i<100000;i++)
{
A.Seek ("=", i,
System.Guid.Empty,System.Guid.Empty,System.Guid.Empty,System.Guid.Empty,System.Guid.Empty,System.Guid.Empty,System.Guid.Empty,System.Guid.Empty,System.Guid.Empty,System.Guid.Empty,System.Guid.Empty,System.Guid.Empty);
//...
}

Thank you.
Antonin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Collection 5

Back
Top