Getting Error 13, help - don't understand why 
Author Message
 Getting Error 13, help - don't understand why

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

Quote:

>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

Documents\PhoneForm\PhoneForm.mdb")

- Show quoted text -

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.



Mon, 09 Jul 2001 03:00:00 GMT  
 Getting Error 13, help - don't understand why
Rick,

He must have another problem, because it's perfectly possible to open a
dynaset that way.

Johnny,

Do you have a reference set to ADO, besides the reference to DAO itself?
If so, try declaring your rs var as DAO.Recordset. Maybe VB is typing the
rs var to an ADODB.Recordset, and that's why you get the type mismatch.

~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please post/reply to the newsgroup(s) so
that everyone can benefit from the discussion.

Regards,

Klaus H. Probst, MCP


       ICQ: 22454937
      The VB Box: http://members.xoom.com/kprobst/
~~~~~~~~~~~~~~~~~~~~~~~~~~~



Quote:
> 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
> Documents\PhoneForm\PhoneForm.mdb")
> >   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.



Mon, 09 Jul 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Can anyone help me understand why I'm getting this exception

2. Help with Error Execution Type '13'

3. Don't understand this error

4. Script errors I don't understand

5. I don't understand memory error rule.

6. I don't understand memory error rule.

7. Help - Don't understand anchors.

8. Please help, I don't understand this!!!

9. Don't understand 'Set'

10. HELP, Can't locate variable, ERROR 13

11. API/function doesn't stop and I don't understand it :o)

12. type mismatch error '13'????

 

 
Powered by phpBB® Forum Software