设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 828|回复: 1
打印 上一主题 下一主题

[其它] why it's pop error msg "Type mismatch"?

[复制链接]
跳转到指定楼层
1#
发表于 2006-5-27 01:05:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Sorry for no Chinese system of mine.

call it: ParamValue("WinZip_FOLDER")
Both of query "qry_ParameterGet" and table "z_Parameters" are exists.



source:
Public Property Get ParamValue(ByVal strItem As String) As String
    Dim objDB As Database
    Dim objQuery As QueryDef
    Dim objRecset As Recordset
    Dim sEnv As String
    Set objDB = CurrentDb
    Set objQuery = objDB.QueryDefs("qry_ParameterGet")
    objQuery.Parameters("[ParameterItem]").Value = strItem
    Set objRecset = objQuery.OpenRecordset 'wrong ! pop error msg "Type mismatch" ,why?!
    If Not (objRecset.BOF And objRecset.EOF) Then
        ParamValue = objRecset.Fields("Value").Value
        If UCase(Right(strItem, 6)) = "WRKDIR" Then
            ' Set the temp variable
            sEnv = Trim(Environ("TEMP"))
            If (sEnv = "") Then
                sEnv = ""
            End If
            ParamValue = sEnv & ParamValue
        End If
    Else
        ParamValue = ""
    End If
End Property
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2006-5-27 14:22:00 | 只看该作者
没有看到文件,不知道具体是如何应用的.试试:

1.引用dao

2.这一句Dim objRecset As Recordset,改为Dim objRecset As dao.Recordset

不一定对.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-9-22 05:39 , Processed in 0.115739 second(s), 26 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表