When you are using a Dynaset you have to be more descriptive with the SQL.
For a table you might be able to get away with that.
Try this:
Set rstLog = dbsPhoneForm.OpenRecordset("SELECT * FROM Log", dbOpenDynaset)
--
Richard Cardarelle
Eclipse Applications
www.eclipseapplications.com
>Been teaching myself VB for a while lately and am starting into the
database
>programmability right now.
>Running VB6 Ent. and trying to add a new record to a table within my
>database. I do not wish to use a bound control for this. I have a series
of
>text boxes and check boxes that are filled out on a form and I wish to add
>their values into a database.
>I am running into a situation that I don't quite follow, since I cut most
of
>the code from an example in the Help file. [AddNew Method Example
DAO)] ]
>I did modify some af the variable names to reflect my program, but made
sure
>I followed them through the sub and got all of them.
>Here's my snippet:
>----begin snippett----
>Function AddNewLog()
>Dim dbsPhoneForm As Database, rstLog As Recordset
> Set dbsPhoneForm = OpenDatabase("C:\My
Quote:> Set rstLog = dbsPhoneForm.OpenRecordset("Log", dbOpenDynaset)
>----end snippett----
>My program halts with a Runtime error '13', Type Mismatch
>When I choose DeBug, the VB IDE highlights the 'Set rstLog' line. I don't
>get it. I want to open this database, write a record to the 'Log' table and
>close the database... am I going about this incorrectly? (I do not want a
>bound control for this)
>I have a table named 'Log' in my database.
>Any help, ideas would be greatly appreciated.