以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  动态组合 提示初始化字符串的格式不符合规范 何解?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=160039)

--  作者:cnsjroom
--  发布时间:2021/1/18 15:42:00
--  动态组合 提示初始化字符串的格式不符合规范 何解?
动态组合  提示初始化字符串的格式不符合规范 何解?

按钮事件代码如下:

Dim cr As new cr.class1
Dim a1 As String = """" & "Data Source= " & e.Form.Controls("TextBox1").text & ";"
Dim a2 As String = "Initial Catalog= " & e.Form.Controls("TextBox2").text & ";"
Dim a3 As String = "user id= " & e.Form.Controls("TextBox3").text & ";"
Dim a4 As String = "Password= " & e.Form.Controls("TextBox4").text & ""","
Dim a5 As String = """" & e.Form.Controls("TextBox5").text & ""","
Dim a6 As String =  """" & e.Form.Controls("TextBox6").text & ""","
Dim a7 As String =  """" & e.Form.Controls("TextBox7").text & ""","
Dim a8 As String =  """" & e.Form.Controls("TextBox8").text & ""","
Dim a9 As String =  """" & e.Form.Controls("TextBox9").text & """"
Dim str As String = a1 &  a2  & a3 & a4 & a5 & a6 & a7 & a8 & a9
e.Form.Controls("TextBox10").text=str   【显示在文本框里的内容和字符是符合标准的】

cr.CreateDatabase("Data Source=" & e.Form.Controls("TextBox1").text & ";Initial Catalog= " & e.Form.Controls("TextBox2").text & "; user id=" & e.Form.Controls("TextBox3").text & ";Password=" & e.Form.Controls("TextBox4").text & """", """"& e.Form.Controls("TextBox5").text &"""",""""& e.Form.Controls("TextBox6").text &"""",""""& e.Form.Controls("TextBox7").text &"""",""""& e.Form.Controls("TextBox8").text &"""",""""& e.Form.Controls("TextBox9").text &"""")
提示错误:

图片点击可在新窗口打开查看此主题相关图片如下:111.png
图片点击可在新窗口打开查看


想实现红色部分  能够实现如下格式的内容
cr.CreateDatabase("Data Source=DESKTOP-4HGMIGM\\SQLEXPRESS;Initial Catalog=master; user id=sa;Password=com", "文件管理","c1","d:\\文件管理.mdf","c2","d:\\文件管理.log")


[此贴子已经被作者于2021/1/18 15:52:05编辑过]

--  作者:有点蓝
--  发布时间:2021/1/18 16:01:00
--  
我也不清楚,第三方的应用请找开发这个应用的人解决。