Kính gửi diễn đàn!
Cho em hỏi em sưu tầm 1 function sql trong excel nhưng nó không chay được
em cám ơn!
Function heo_sql(sql_string As String)
Dim cn As Object, rs As Object
Set cn = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
With cn
.ConnectionString = "provider=microsoft.ace.aledb.12.0;data source=" & Chr(39) & ThisWorkbook.FullName & Chr(39) & ";extended properties=""excel 12.0 xml;hdr=yes;imex=1"";"
.Open
End With
Set rs = cn.Execute(sql_string)
heo_sql = Application.Transpose(rs.GETROWS())
Set rs = Nothing: Set cn = Nothing
End Function
Cho em hỏi em sưu tầm 1 function sql trong excel nhưng nó không chay được
em cám ơn!
Function heo_sql(sql_string As String)
Dim cn As Object, rs As Object
Set cn = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
With cn
.ConnectionString = "provider=microsoft.ace.aledb.12.0;data source=" & Chr(39) & ThisWorkbook.FullName & Chr(39) & ";extended properties=""excel 12.0 xml;hdr=yes;imex=1"";"
.Open
End With
Set rs = cn.Execute(sql_string)
heo_sql = Application.Transpose(rs.GETROWS())
Set rs = Nothing: Set cn = Nothing
End Function