Getting Error 13, help - don't understand why

Getting Error 13, help - don't understand why

Post by Rick Cardarell » Fri, 22 Jan 1999 04:00:00



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")

- 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.

 
 
 

Getting Error 13, help - don't understand why

Post by Klaus H. Probs » Fri, 22 Jan 1999 04:00:00


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/
~~~~~~~~~~~~~~~~~~~~~~~~~~~



> 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.


 
 
 

1. Help: SO get's hidden and I don't understand why

Hi,

I am currently struggling with SO's and I found this strange behaveour. I
try to explain.

I have a SmartWindow (say a.w) that is a container for 1 SDO and 2 SW's. I
run a.w from another SO, which is a SmartDataField (say b.w). The idea is
that a.w should give the user the opportunity to make some kind of selection
and upon termination of a.w, the results should be returned to the
SmartDataField and displayed there.

(I hope sofar I haven't said anything strange SmartObject-wise!)

I run my code from within the AppBuilder (just to test). No all is well,
until I close down a.w. Instead of seeing a.w dissapear and focus being
returned to b.w, everything disappears but the AppBuilder tells me there is
still something running. I consider that strange (at least not what I
anticipated).

Upon closer investigation in de debugger, I saw that the procedure
'hideObject' in a.w's smart.p is responsible for this behaveour. Apparently
it searches it's container-handle and hides that one. Something like this:

  {get ContainerHandle hContainer}.

  IF VALID-HANDLE(hContainer) THEN
         ASSIGN hContainer:HIDDEN = YES.

I don't understand why this happens. I can understand that an object hides
itself before termination, but I don't understand why the handle of b.w
seems to be used to hide it as well! When I display the values of the
handles of a.w, b.w and even the handle of b.w's frame, they are not the
same!

Can anyone out there shed some light on this and, more importantly, tell me
what to do to prevent this from happening?

(I hope I have stated my problem and my questions clearly enough)

TIA

Pieter Brouwer.

2. Help!!!!!!!

3. Don't understand Fullpath() - not getting results I expect

4. ODBC for Informix

5. I don't understand why this worked in 7.0 and now not in 2000

6. US-NY-TECHNICAL WORKFLOW

7. SP returning duplicate values but I don't understand why

8. Oracle 8i client Dr Watson

9. I don't understand why this view is not updatable

10. Don't understand why it is ambiguous

11. Event ID:17045 don't understand why

12. Error with select statement I don't understand

13. sql error I don't understand