Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 7th, 2006, 05:46 AM
Authorized User
 
Join Date: Mar 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default run time error 13

hi;
i try to a program.this program only makes query on network.(the database's into other host on network) codes:
Dim db1 As Database
Dim rs1 As Recordset
Set db1 = OpenDatabase("\\kiosk\kart\personel.mdb")
Set rs1 = db1.OpenRecordset("select * from kayit where tarih='" & Label4.Caption & "'")
While Not rs1.EOF
Text2.Text = rs1("tarih")
Text3.Text = rs1("adisoyadi")
Text4.Text = rs1("bolumu")
Text7.Text = rs1("unvani")
Text5.Text = rs1("girissaati")
Text6.Text = rs1("cikissaati")
rs1.MoveNext
Wend
......
...
...
End Sub
But gives me error (run time error 13) at Set rs1 = db1.OpenRecordset("select * from kayit where tarih='" & Label4.Caption & "'")
Please help me.What i can do

 
Old May 1st, 2006, 04:54 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'll take a guess at this.

Is it possible that you are referencing both ADODB and DAO components in your project?
If so, try qualifying your object variables like so:

    Dim rs1 As DAO.Recordset
    Dim db1 As DAO.Database

It is very possible that you are having an ambiguity issue... that db1.OpenRecordset call is going to be retrieving a DAO.Recordset object, and if the rs1 variable is typed as an ADODB.Recordset object you will get the type mismatch (13) error.

You might also want to use the ADODB objects rather than the DAO objects altogether. There might be some reasons to use DAO, but that is almost ancient technology now... but then, that could be said of ADODB, I guess.

woody Z http://www.learntoprogramnow.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
run-time error 13: type mismatch bryan.lugo Excel VBA 2 April 19th, 2006 04:39 AM
run time error 13 selamiduvar Access VBA 3 March 7th, 2006 07:46 PM
run time error 13 selamiduvar Pro VB 6 1 March 7th, 2006 08:08 AM
OpenRecordset And Run-Time Error 13 Type Mismatch Pavesa Access VBA 5 March 22nd, 2005 05:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.