ASP.NET数据源

时间:2017-03-20 13:36:54

标签: asp.net vb.net

我想放弃"数据源"链接我的数据库的路径(下面的代码),但它始终采用" C:\ Windows"在开头所以我有这个错误:"确保路径名是正确的。"

SelectStatement_24 = "Select * From Users Where User_ID=" & User_Num
ConnectString_24 = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=..\Applis\gestion_actions.mdb"
Connect_24.ConnectionString = ConnectString_24
Adapter_24.SelectCommand = New OleDbCommand(SelectStatement_24,Connect_24)
Adapter_24.Fill(ClassyDS_24,"Utilisateur_Info")

1 个答案:

答案 0 :(得分:0)

将您的连接字符串更改为

 ConnectString_24= "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("~/") & "//Applis//gestion_actions.mdb"