Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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:41 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 March 7th, 2006, 07:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Hello,

Fully qualify your object variable names.

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

 
Old March 7th, 2006, 07:30 AM
Authorized User
 
Join Date: Mar 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you so much.it is litle thing but i dont think about that.realy thanks

 
Old March 7th, 2006, 07:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

You're welcome. Its a common oversight. ADO is Access's default data access object model. Your code thought you wanted an ADO recordset, is all.

Bob






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 selamiduvar VB Databases Basics 1 May 1st, 2006 04:54 PM
run-time error 13: type mismatch bryan.lugo Excel VBA 2 April 19th, 2006 04:39 AM
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.