Open DAO Recordset
-
I want to open a DAO Recordset Database tempDB; Recordset rstbl; rstbl = tempDB.OpenRecordset("SELECT Name FROM myTblNames", DAO.RecordsetTypeEnum.dbOpenTable, DAO.RecordsetOptionEnum.dbReadOnly , DAO.LockTypeEnum.dbPessimistic ); Error is Invalid argument
-
I want to open a DAO Recordset Database tempDB; Recordset rstbl; rstbl = tempDB.OpenRecordset("SELECT Name FROM myTblNames", DAO.RecordsetTypeEnum.dbOpenTable, DAO.RecordsetOptionEnum.dbReadOnly , DAO.LockTypeEnum.dbPessimistic ); Error is Invalid argument
Why are you using DAO? First of all, it was superceeded long ago by ADO. And since this is the C# forum, I can only assume you're using C#. So why aren't you using ADO.NET? It's a hell of a lot easier in .NET applications and has many benefits over plain ADO (like easy parameterized queries, data adapters, and more). You can find more information about ADO.NET in the .NET Framework SDK: Accessing Data using ADO.NET[^]. There's also several technical articles in MSDN with examples: ADO.NET[^].
Microsoft MVP, Visual C# My Articles