Internet客户端错误:无法连接到服务器 [英] Internet Client Error: Cannot Connect to Server

查看:837
本文介绍了Internet客户端错误:无法连接到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码如下:-
----------------

My code as below :-
----------------

Dim oledbCon As New OleDbConnection
Dim oledbCmd As OleDbCommand
Dim oledbAdp As New OleDbDataAdapter
Dim oledbCmdBuilder As OleDbCommandBuilder
Dim lDs As DataSet

oledbCon.ConnectionString = "Provider=MS Remote;Remote Server=http://MAIN;Remote Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Company.mdb"
oledbCon.Open()

If oledbCon.State = ConnectionState.Open Then
oledbCmd = New OleDbCommand
lDs = New DataSet
Dim str As String = "Select * from Users"
        oledbCmd.CommandType = cmdType
        oledbCmd.Connection = oledbCon
        oledbCmd.CommandText = strAccQuery
        oledbAdp.SelectCommand = oledbCmd
        If (lDs.Tables(tblName) Is Nothing) Then
            oledbCmdBuilder = New OleDbCommandBuilder(oledbAdp)
            oledbAdp.Fill(lDs, tblName)
        End If
  MsgBox("User Name :" & lDs.Tables("Users").Rows(0)("UserName") & vbCrLf &         "Password :" & lDs.Tables("Users").Rows(0)("Password"))
End If



MS Access数据库连接了MAIN(''c:\ Company.mdb'')的远程数据源
但是错误发生在行''



MS Access Database is connect the remote datasource of MAIN(''c:\Company.mdb'')
But error occur in line ''

oledbAdp.Fill(lDs, tblName)

''
消息显示为"Internet客户端错误:无法连接到服务器"

我该如何解决以上问题??
请帮助解决此问题.........

''
The msg shown ''Internet Client Error: Cannot Connect to Server''

How will i solve above problem???
Please help of this problem........

推荐答案

您从何处获得该连接字符串?在很多方面都是错误的,这几乎很有趣.

您不能通过HTTP使用Access数据库.由于Access是基于文件的数据库引擎,因此只能在网络共享上使用.

此处 [ ^ ]是Access连接字符串的选项.
Where on earth did you get that connection string from? It''s wrong in so many ways it''s almost funny.

You cannot use an Access database over HTTP. Since Access is a file-based database engine, it can ONLY be used over a network Share.

Here[^] are your options for an Access connection string.


这篇关于Internet客户端错误:无法连接到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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