Hi, i am automating data transfer from Access 2007 to Excel 2007 and am having trouble with setting up the connection.
below is what i have so far but i am having no luck with connecting to the data base via the connection string an defining my record set.
i am also having trouble with figuring out how to paste the data selected from the table over to excel.
Any ideas????
Dim strMyDB As String
Dim conMyDB As ADODB.Connection
Dim rstMyDB As ADODB.Recordset
Dim strQuery As String
strMyDB = "C:\Users\Shadow\Documents\University\Year 4 Information systems\Project\DataBase.accdb;"
Set conMyDB = New ADODB.Connection
conMyDB.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & strMyDB & "';" _
& "ACE.OLEDB"
Set rstMyDB = New ADODB.Recordset
strQuery = "SELECT * FROM Table2"
below is what i have so far but i am having no luck with connecting to the data base via the connection string an defining my record set.
i am also having trouble with figuring out how to paste the data selected from the table over to excel.
Any ideas????
Dim strMyDB As String
Dim conMyDB As ADODB.Connection
Dim rstMyDB As ADODB.Recordset
Dim strQuery As String
strMyDB = "C:\Users\Shadow\Documents\University\Year 4 Information systems\Project\DataBase.accdb;"
Set conMyDB = New ADODB.Connection
conMyDB.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & strMyDB & "';" _
& "ACE.OLEDB"
Set rstMyDB = New ADODB.Recordset
strQuery = "SELECT * FROM Table2"