6 个解决方案
#2
我知道用那个啊,但是一直不成功,我的代码
Dim cn As New adodb.Connection '定义数据库的连接
Dim Rs As New adodb.Recordset
Dim sqlstr As String
cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CSL;Data Source=MICROSOF-1557BB"
Rs.CursorLocation = adUseClient
sqlstr = "create TABLE ‘“ & Text1.text &”’(日期 datetime,'" & Text2.Text & "' real,'" & Text3.Text & "' real,'" & Text4.Text & "' real,'" & Text5.Text & "' real)"
Rs.Open sqlstr, cn
一直显示有语法错误
Dim cn As New adodb.Connection '定义数据库的连接
Dim Rs As New adodb.Recordset
Dim sqlstr As String
cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CSL;Data Source=MICROSOF-1557BB"
Rs.CursorLocation = adUseClient
sqlstr = "create TABLE ‘“ & Text1.text &”’(日期 datetime,'" & Text2.Text & "' real,'" & Text3.Text & "' real,'" & Text4.Text & "' real,'" & Text5.Text & "' real)"
Rs.Open sqlstr, cn
一直显示有语法错误
#3
麻烦大家帮我看,错在哪?我是用VB两SQL2000哦
#4
所有的单引号、双引号都必须是英文的,而不能是中文的。
#5
sqlstr = "create TABLE " & Text1.text & "(日期 datetime," & Text2.Text & " real," & Text3.Text & " real," & Text4.Text & " real," & Text5.Text & " real)"
#6
谢谢大家,解决了
#1
使用Create Table
看看这个
看看这个
#2
我知道用那个啊,但是一直不成功,我的代码
Dim cn As New adodb.Connection '定义数据库的连接
Dim Rs As New adodb.Recordset
Dim sqlstr As String
cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CSL;Data Source=MICROSOF-1557BB"
Rs.CursorLocation = adUseClient
sqlstr = "create TABLE ‘“ & Text1.text &”’(日期 datetime,'" & Text2.Text & "' real,'" & Text3.Text & "' real,'" & Text4.Text & "' real,'" & Text5.Text & "' real)"
Rs.Open sqlstr, cn
一直显示有语法错误
Dim cn As New adodb.Connection '定义数据库的连接
Dim Rs As New adodb.Recordset
Dim sqlstr As String
cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CSL;Data Source=MICROSOF-1557BB"
Rs.CursorLocation = adUseClient
sqlstr = "create TABLE ‘“ & Text1.text &”’(日期 datetime,'" & Text2.Text & "' real,'" & Text3.Text & "' real,'" & Text4.Text & "' real,'" & Text5.Text & "' real)"
Rs.Open sqlstr, cn
一直显示有语法错误
#3
麻烦大家帮我看,错在哪?我是用VB两SQL2000哦
#4
所有的单引号、双引号都必须是英文的,而不能是中文的。
#5
sqlstr = "create TABLE " & Text1.text & "(日期 datetime," & Text2.Text & " real," & Text3.Text & " real," & Text4.Text & " real," & Text5.Text & " real)"
#6
谢谢大家,解决了