错误13(类型不匹配 [英] Error 13 ( Type mismatch

查看:263
本文介绍了错误13(类型不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。


我有这个错误,不知道该怎么办。我正在使用vb 6和访问数据库


这是我的代码


代码vb:


公共数据库作为数据库

公共记录集

公共作为工作区


公共函数initdb()

''On Error GoTo错误

设置ws = DBEngine.Workspaces(0)

设置db = ws.OpenDatabase(App.Path&" \ resultchecker.mdb")
设置rs = db.OpenRecordset(" candres",dbOpenTable)


退出功能


我试图打开数据库,但它一直给出类型不匹配。

请帮助

Hello everyone

Am having this error an just dont know what to do. Am using vb 6 and access database

This is my code

code vb:

Public db As Database
Public rs As Recordset
Public ws As Workspaces

Public Function initdb()
''On Error GoTo error
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(App.Path & "\resultchecker.mdb")
Set rs = db.OpenRecordset("candres", dbOpenTable)

Exit Function

am trying to open the database but it keeps giving type mismatch.
please help

推荐答案

我不'我对数据库一无所知,但是你不可能将ws声明为工作空间而不是工作空间 s 吗? (这只是猜测)
I don''t know anything about databases, but isn''t it possible you have to declare ws as a workspace, instead of workspaces? (it''s just a guess)



我对数据库一无所知,但是你不可能必须将ws声明为工作空间,而不是工作空间 s ? (这只是一个猜测)
I don''t know anything about databases, but isn''t it possible you have to declare ws as a workspace, instead of workspaces? (it''s just a guess)



是的你是对的我有更改数据。我仍然有错误

请帮助

Yes u are right i have change dat. I still have the error though
Pls help


你肯定有两种不同的数据类型,这就是你得到错误的原因。您是否明确定义了数据格式? - 如果没有,可能会有一个隐含的定义,而不是你认为的隐含定义。


我的尝试是使用显式定义。 (你应该找出错误的位置)
Well you definately have two different data types, that''s why you get the error. Did you define the data format explicit or not? - If not there might be an implicid definition that is not what you thought would be the implicit definition.

My try would be to use explicit definitions. (You should find out where the error is then)


这篇关于错误13(类型不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆