hard to say without seeing your code. are you doing some loop around the getrows? then i'd say you loop once too often because i tried getrows one a single record and this works nicely:Am I doing someone wrong?
while this fails:Code:Sub a() Dim cn As New Connection cn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Database1.accdb;Persist Security Info=False;" Dim rs As Recordset Set rs = cn.Execute("SELECT TOP 1 * FROM tbl1") Dim vFieldValues() As Variant vFieldValues = rs.GetRows cn.Close End Sub
Code:Sub a() Dim cn As New Connection cn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Database1.accdb;Persist Security Info=False;" Dim rs As Recordset Set rs = cn.Execute("SELECT TOP 1 * FROM tbl1") Dim vFieldValues() As Variant vFieldValues = rs.GetRows vFieldValues = rs.GetRows cn.Close End Sub




Reply With Quote