VB绝对路径变成相对路径的问题
相对路径:sqlconnection="provider=microsoft.jet.oledb.4.0;datasource="&App.Path&"123.mdb;U...
相对路径:
sqlconnection = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "123.mdb;User ID=Admin;Jet OLEDB:Database Password=123456"
rs.Open "select * from yhb where name = '" & Trim(suser) & "' and password= '" & Trim(spassword) & "'", sqlconnection
绝对路径
sqlconnection = "provider=microsoft.jet.oledb.4.0;data source=" 'e:\管理\123.mdb';User ID=Admin;Jet OLEDB:Database Password=123456"
为什么下面这句话运行不了了,能帮忙找找原因吗?谢谢~
rs.Open "select * from yhb where name = '" & Trim(suser) & "' and password= '" & Trim(spassword) & "'", sqlconnection 展开
sqlconnection = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "123.mdb;User ID=Admin;Jet OLEDB:Database Password=123456"
rs.Open "select * from yhb where name = '" & Trim(suser) & "' and password= '" & Trim(spassword) & "'", sqlconnection
绝对路径
sqlconnection = "provider=microsoft.jet.oledb.4.0;data source=" 'e:\管理\123.mdb';User ID=Admin;Jet OLEDB:Database Password=123456"
为什么下面这句话运行不了了,能帮忙找找原因吗?谢谢~
rs.Open "select * from yhb where name = '" & Trim(suser) & "' and password= '" & Trim(spassword) & "'", sqlconnection 展开
2个回答
展开全部
ConnectionString='Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=" +server.mappath "("data\xibuzhilv.mdb")'
应该是
ConnectionString='Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=' +server.mappath ("data\xibuzhilv.mdb")
Data Source=" +server.mappath "("data\xibuzhilv.mdb")'
应该是
ConnectionString='Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=' +server.mappath ("data\xibuzhilv.mdb")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询