excel vba - run time error - Your network access was interrupted Error in VBA -


i have small excel macro uses ado connection fetch data ms access database. while writing code following error started appearing. tried closing excel work book , open again , close access database , open again error still coming.

the excel file , access database both in same folder on c drive.

run time error - 2147467259 (80004005) : network access interrupted. continue close database, , open again

dim cn adodb.connection dim ors adodb.recordset set cn = createobject("adodb.connection") dbpath = "c:\[databse path]" & "\[database name].accdb" dbws = "[excel sheet name]" scn = "provider=microsoft.ace.oledb.12.0;data source=" & dbpath dsh = "[" & "[excel sheet name]" & "$]" cn.open scn dim ssql string  dim f integer  ssql = "select 'w',a.[subledger],null,sum(a.[amount]) gl_table a.[opex_group] = 10003 , year(a.[g/l date]) = " & year(sheets("repairs").cells(1, 4)) & " , month(a.[g/l date]) = " & month(sheets("repairs").cells(1, 4)) ssql = ssql & " group " & "a.[subledger],(year(a.[g/l date])),(month(a.[g/l date]))" set ors = cn.execute(ssql) debug.print ors.recordcount ors.close ....... further code print excel here  cn.close end sub` 


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -