您的位置:程序门 -> .net技术 -> vb.net



未处理的“system.runtime.interopservices.comexception”类型的异常


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


未处理的“system.runtime.interopservices.comexception”类型的异常[已结贴,结贴人:u2wildman]
发表于:2007-04-23 09:59:40 楼主
写了一段登录代码     然后运行   出现下列问题         vb.net中的


未处理的“system.runtime.interopservices.comexception”类型的异常出现在   工程1.exe   中。

其他信息:   未找到提供程序。该程序可能未正确安装。


请教各位达人如何解决
发表于:2007-04-23 10:02:381楼 得分:0
private   sub   _command1_0_click(byval   sender   as   system.object,   byval   e   as   system.eventargs)   handles   _command1_0.click
                dim   strsql   as   string
                dim   cn   as   new   adodb.connection
                dim   rs   as   new   adodb.recordset
                cn.connectionstring   =   "provider=computer;data       source=new;initial       catalog=northwind;user       id=sa;password=; "
(黄色箭头)cn.open()
                rs.cursorlocation   =   aduseclient
                strsql   =   "select       密码       from       new       where       登录名= ' "   &   用户登录_renamed.text   &   " ' "
                rs.open(strsql,   cn,   adopenstatic,   adlockreadonly)
                if   rs.recordcount   =   0   then
                        msgbox( "用户名不正确 ")
                else
                        if   rs.fields(0).value   =   text1.text   then
                                msgbox( "登录成功 ")
                        else
                                msgbox( "密码错误 ")
                        end   if
                end   if

        end   sub


这是代码       运行后有个黄色的箭头指向cn.open()这一行
发表于:2007-04-23 11:15:552楼 得分:0
没有人会么?????????/
发表于:2007-04-27 09:36:383楼 得分:0
哭       没人管了
发表于:2007-04-27 17:17:104楼 得分:0
到其他机器上试试呢?
发表于:2007-04-27 17:17:495楼 得分:0
当然要满足您的程序要求的。
发表于:2007-04-27 17:49:036楼 得分:0
adodb??   什么老东西了
发表于:2007-04-28 22:36:377楼 得分:0
关键是怎么解决啊
发表于:2007-04-28 22:37:238楼 得分:0
老东西     那你给个新的也行啊     只要能实现了功能就行啊
发表于:2007-04-28 22:37:409楼 得分:0
我就郁闷了
发表于:2007-04-29 08:56:4910楼 得分:0
您用的是什么数据库?
发表于:2007-04-29 23:59:3211楼 得分:0
sql2000
发表于:2007-04-30 00:25:4312楼 得分:0
public   connectionstring   as   string   =   "server=10.1.0.157; "   &   "database=flaxdb;integrated   security=true; "
发表于:2007-04-30 00:27:4613楼 得分:0
dim       cn       as       system.data.sqlclient.sqlconnection      
    dim       constr       as       string      
    constr= "workstation       id=你的ip;packet       size=4096;user       id=sa;data       source=你的ip;initial       catalog=你的数据库名称;password= "       "      
    cn       =       new       sqlconnection(constr)      
    cn.open()
发表于:2007-05-08 10:49:2314楼 得分:0
还是没有解决啊                 等待中。。。。。。。。。。。。。。。。。。。。。。。。。。。。
发表于:2007-05-08 11:00:5515楼 得分:90
'   您先试试吧,您那段程序看来有年头了
private   sub   _command1_0_click(byval   sender   as   system.object,   byval   e   as   system.eventargs)   handles   _command1_0.click
        dim   strsql   as   string
        dim   cn   as   new   sqlclient.sqlconnection
        dim   rs   as   new   dataset
        cn.connectionstring   =   "provider=computer;data   source=new;initial   catalog=northwind;user   id=sa;password=; "
        '   不知道这个 "provider=computer "对不对,您是从书上看来的吧
        cn.open()
        '   rs.cursorlocation   =   aduseclient       '   不知道这一句的用处
        strsql   =   "select   密码   from   new   where   登录名= ' "   &   用户登录_renamed.text   &   " ' "
        '   rs.open(strsql,   cn,   adopenstatic,   adlockreadonly)
        dim   da   as   new   sqlclient.sqldataadapter(strsql,   cn)
        dim   count   as   int32   =   da.fill(rs)
        if   count   =   0   then
                msgbox( "用户名不正确 ")
        else
                if   rs.tables(0).rows(0)(0).value   =   text1.text   then
                        msgbox( "登录成功 ")
                else
                        msgbox( "密码错误 ")
                end   if
        end   if
end   sub
发表于:2007-05-08 11:03:1916楼 得分:0
您现在用的环境是什么,您的代码好像是6.0里面的,现在要转成.net么?
发表于:2007-05-08 11:12:5017楼 得分:10
system.runtime.interopservices.comexception这个好像是权限问题
发表于:2007-05-08 11:16:4618楼 得分:0
http://support.microsoft.com/kb/815633/zh-cn可以参考一下
发表于:2007-05-08 11:53:5619楼 得分:0
确定有装sql么?
发表于:2007-05-08 11:56:0220楼 得分:0
orkstation   id=计算机名字;packet   size=4096;user   id=sa;data   source= '. ';persist   security   info=false;initial   catalog=数据库名

这样试试
发表于:2007-05-11 10:16:2521楼 得分:0
现在用的是vb.net
发表于:2007-05-14 10:07:5222楼 得分:0
magicbacon(cannot   help   coding)


运行你给的那段代码,提示是
未处理的“system.argumentexception”类型的异常出现在   system.data.dll   中。

其他信息:   不支持关键字:   “provider”。


去掉provider=computer
提示是
未处理的“system.data.sqlclient.sqlexception”类型的异常出现在   system.data.dll   中。

其他信息:   系统错误。


求个解决方法!!!!!!!!!!
发表于:2007-05-14 10:21:5023楼 得分:0
forgot(忘记forgot2000)


你里面说的ip是什么意思,ip地址???还是计算机名??又或者是什么??


快速检索

最新资讯
热门点击