双数据源的情况下,在项目属性中怎么设置?一个是access一个是sql
BeforeConnectOuterDataSource
这个事件的代码
e.C & e.ProjectPath & "data\cqj.mdb;Persist Security Info=False;Jet OLEDB:Database Password=liming@93422lm88.."
Dim ipFile As String = e.ProjectPath & "server.txt"
If e.Name ="sql" Then '' e.Name = "sqlgcgl" 这个是数据源名称
If Filesys.FileExists(ipFile) Then
Dim str As String = FileSys.ReadAllText(ipFile)
If Connections.TryConnect(str) = False Then
canConnect = False
str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & e.ProjectPath & "temp.MDB;Persist Security Info=False"
Else
canConnect = True
End If
e.ConnectionString = str
Else
canConnect = False
Dim st As String
st = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & e.ProjectPath & "temp.MDB;Persist Security Info=False"
e.ConnectionString = st
End If
End If
,sql数据源用不了,报错
Dim cmd As new sqlcommand
cmd.C
cmd.Parameters.Clear
cmd.CommandText="s elect mbno as 会员编号,mbname as 会员姓名,mbtel as 电话,mbmobile as 手机,mbspellname as id from {pos_mbInfo}"
Tables("会员查找下拉_table1").DataSource=cmd.ExecuteReader
这个语句报错,提示access数据源不存在这个表,我明明指定了,还不行
[此贴子已经被作者于2020/12/2 12:34:48编辑过]