未指定的错误Adodb MS Access VB2008 [英] Unspecified Error Adodb MS Access VB2008

查看:64
本文介绍了未指定的错误Adodb MS Access VB2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Public Function gSQL(ByVal strSQL As String) As ADODB.Recordset
        Dim cnn As ADODB.Connection
        Dim rs As ADODB.Recordset
        Dim cmd As ADODB.Command
        Dim strcnn As String
        cnn = New ADODB.Connection
        cmd = New ADODB.Command
        rs = New ADODB.Recordset
        strcnn = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=C:\Program Files\Att2008\att2000.mdb"
        If cnn.State = ConnectionState.Open Then
            cnn.Close()
        End If
        cnn.Open(strcnn) 'this part is raising an error but all it says is "unspecified error"
        cmd.let_ActiveConnection(cnn)
        cmd.CommandType = ADODB.CommandTypeEnum.adCmdText
        cmd.CommandText = strSQL
        rs.CursorLocation = ADODB.CursorLocationEnum.adUseClient
        rs.CursorType = ADODB.CursorTypeEnum.adOpenStatic
        rs.LockType = ADODB.LockTypeEnum.adLockOptimistic
        rs.Open(cmd)
        gSQL = rs
    End Function



这种错误的可能原因和解决方法是什么?令我感到困惑的是,有一台计算机上我的程序运行正常,而另一台计算机上却没有.计算机的处理器是否可以成为此因素?

在该程序正在运行的计算机上,我有一个P4 2.4GH处理器和512MB
另一台计算机具有更高的规格..如iCore 3和大约2gb的内存..

请帮助我解决这个问题..预先感谢..



what could be the possible reason and workaround for this kind of error. what confuses me is there is one computer that my program is running smoothly but on the other computers its not. does the processor of the computer can be a factor for this?

on the computer that the program is working i have a P4 2.4GH processor and 512MB
the other computer have a higher specs.. like iCore 3 and about 2gb memory..

please help me to fix this prob.. thanks in advance..

推荐答案

两种解决方案:

1.更改数据库文件的位置.除"c:/"或程序文件"或系统文件夹之外的任何地方.

2.通过更改清单文件来更改应用程序的权限.

搜索
Two solutions :

1. Change the location of the database file. Anywhere except "c:/" or "Program Files" or System Folders.

2. Change the permissions of the application by changing the manifest file.

Search
<requestedexecutionlevel level="asInvoker" uiaccess="false" /> 


并替换

"asInvoker"

"requireAdministrator"



虽然第一个既可行又无麻烦.让我知道它是否有效.



Though the first one is both feasible and hasle free. Do let me know if it worked.


这篇关于未指定的错误Adodb MS Access VB2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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