vb from子句语法错误
PublicstrconnAsString'用来接受数据库连接字符串PublicconnAsConnectionPublicstrsqlAsStringPublicrsA...
Public strconn As String '用来接受数据库连接字符串
Public conn As Connection
Public strsql As String
Public rs As Recordset '定义数据结果集对象
Public strlnt As String '定义一个strlnt 公共变量记录登录用户的帐号
Public Sub database()
Set conn = New ADODB.Connection '创建数据库连接对象
str conn = "provider=microsoft.ace.olede.12.0; data source=" & App.Path & "\client.accdb"
conn.Open strconn '打开数据库连接
conn.CursorLocation = adUseClient
End Sub
Public Function querybycondition(strsql As String) As Recordset
Call database
Set querybycondition = conn.Execute(strsql) '执行SQL语句,用数据集保存结果 ←黄色箭头
End Function
Public Sub closeconnection()
conn.Close '关闭数据库连接
End Sub
求大神 展开
Public conn As Connection
Public strsql As String
Public rs As Recordset '定义数据结果集对象
Public strlnt As String '定义一个strlnt 公共变量记录登录用户的帐号
Public Sub database()
Set conn = New ADODB.Connection '创建数据库连接对象
str conn = "provider=microsoft.ace.olede.12.0; data source=" & App.Path & "\client.accdb"
conn.Open strconn '打开数据库连接
conn.CursorLocation = adUseClient
End Sub
Public Function querybycondition(strsql As String) As Recordset
Call database
Set querybycondition = conn.Execute(strsql) '执行SQL语句,用数据集保存结果 ←黄色箭头
End Function
Public Sub closeconnection()
conn.Close '关闭数据库连接
End Sub
求大神 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询