I have a module that creates a database on the fly when a user selects an option on a form. The problem I am having is that I can't connect to it. I have been through tons of source code and have spent about 5 hours trying to get adodc to connect to it, but all I get are errors...

Can someone please show me how to connect adodc and datagrid to the database in code???

The database has one table called SNTABLE. I created using CreateTableDef.

There is then an index called INDEX1 with 4 fields.

When I do a loop to retrieve the flields and show them in the debugger they all come back fine.

How do I get adodc to connect to the database using Jet and then have the datagrid load the fields? Remember this has to be done on the fly in code because the database will change. Also I need to use adodc and the datagrid.

I have tried every combination of everything I could think of and have had nothing but errors. Any help will be appreciated!