vb.net OLEDB远程连接字符串 [英] vb.net OLEDB Remote connection String

查看:53
本文介绍了vb.net OLEDB远程连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有vb.net windows应用程序我需要连接访问数据库,这是在我的网络服务器(www.mywebsite.com)

所以请帮助我



此代码不起作用(错误信息 - Internet服务器错误:找不到对象/模块)



Dim myConnection作为OleDbConnection

Dim selectCommand As OleDbCommand

Dim myRead As OleDbDataReader



Dim strMyCon As String =



strMyCon =Provider = MS Remote; Remote Server = http://198.252.63.44; Remote Provider = Microsoft.Jet.OLEDB.4.0; Data Source = / wwwroot / VehicleP_DB.mdb; Uid =; Pwd =;



myConnection =新OleDbConnection(strMyCon)

myConnection.Open()





selectCommand =新OleDbCommand(" SELECT * FROM TblUser",myConnection)

myRead = selectCommand.ExecuteReader



Dim str PassWD As String

strPassWD =

Do while myRead.Read

strPassWD = myRead.GetString(2).TrimEnd

循环

myRead.Close()

i have vb.net windows application i need to connect with access database which is in my web server (www.mywebsite.com)
so please help me

this code does not work (Err Msg - Internet Server Error: Object/module not found)

Dim myConnection As OleDbConnection
Dim selectCommand As OleDbCommand
Dim myRead As OleDbDataReader

Dim strMyCon As String =""

strMyCon = "Provider=MS Remote; Remote Server=http://198.252.63.44;Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=/wwwroot/VehicleP_DB.mdb;Uid="";Pwd="";"

myConnection = New OleDbConnection(strMyCon)
myConnection.Open()


selectCommand = New OleDbCommand("SELECT * FROM TblUser", myConnection)
myRead = selectCommand.ExecuteReader

Dim strPassWD As String
strPassWD = ""
Do While myRead.Read
strPassWD = myRead.GetString(2).TrimEnd
Loop
myRead.Close()

推荐答案

你的问题太笼统了。你有什么特别的麻烦?您收到了什么错误消息?你用的是什么代码?如果你只是告诉我们一些事情被打破了,我们就无法帮助你。我们不会看到你所看到的。



从问题的主题行看,你需要帮助建立一个连接字符串。有一个很好的资源可以帮助你....

http://www.connectionstrings。 com / [ ^ ]



如果这不是您需要的帮助,请提供有关您的问题的更多信息。
Your question is too general. What specifically are you having trouble with? What error messages are you getting? What code are you using? We can''t help you if you just tell us something is broken. We aren''t there to see what you see.

From the subject line of your question, it sounds like you need help building a connection string. There is a great resource out there that can help you with that....
http://www.connectionstrings.com/[^]

If this isn''t what you need help with, please provide more information about your problem.


您根本不想使用RDS。它已经被推荐了很长一段时间,并且从Windows 8和Server 2012开始逐渐消失。



来自MSDN:

从Windows 8和Windows Server 2012开始,Windows操作系统中不再包含RDS服务器组件(有关详细信息,请参阅Windows 8和Windows Server 2012兼容手册)。将来的Windows版本中将删除RDS客户端组件。避免在新的开发工作中使用此功能,并计划修改当前使用此功能的应用程序。使用RDS的应用程序应迁移到 WCF数据服务 [ ^ ]。



你应该通过Web服务,WebAPI或类似方式公开您的数据,然后您的应用程序代码可以连接到它并在代码之外操作数据。
You do NOT want to use RDS at all. It''s been deprecated for quite a while now and is disappearing from Windows starting with Windows 8 and Server 2012.

From MSDN:
Beginning with Windows 8 and Windows Server 2012, RDS server components are no longer included in the Windows operating system (see Windows 8 and Windows Server 2012 Compatibility Cookbook for more detail). RDS client components will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Applications that use RDS should migrate to WCF Data Service[^].

You should be exposing your data through a web service, WebAPI, or similar then your application code can connect to that and have the data manipulated outside of your code.


这篇关于vb.net OLEDB远程连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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