I'm working on Excel VBA macros and I want to retrieve data from a MS Access database (.accdb file).
I've tried using below connection string and it throws runtime error '438'
Dim cn As Object, rs As Object,DBFullName As String,Target As Range
DBFullName = "D:\Tool_Database\Tool_Database.accdb"
Set Target = Sheets("Sheet1").Range("A1")
Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & DBFullName & ";"
Set rs = CreateObject("ADODB.Recordset")
rs.Open "SELECT * FROM test", cn, , , adCmdText
For int i = 0 To rs.Fields.Count - 1
Target.Offset(1, i).Value = rs.Fields(i).Name
Next
Target.Offset(1, 0).CopyFromRecordset rs
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
PLease help me to resolve the error
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)