Switch from DAO to ADO
With ADO, you can build all your code around a local database and then, very easily change one line of code that will allow you to access a database on a SQL Server.
The thing that took me a while to figure out, was how to connect to a database. With DAO, you use the OpenDatabase command passing the path of the database as one of the arguements. But with ADO, you need to build a connection string. To connect to a local database, use the following connection string:
ConnectionString = "Provider=Microsoft.JET.OLEDB.3.51; _ Data Source=c:\mydb.mdb"
That may seem a bit cumbersome, but this flexibility provides you with the means to connect to almost any database in any format anywhere. The following connection string is used to connect to a SQL Sever database named 'people':
ConnectionString = "driver=[SQLServer]; _ uid=admin;server=myserver;database=people"
Page 2 of 5