I am having a problem with setting the Data Source when it is set to CurrentDB. If I set the path to c:\test\mydatabase.mdb it works fine. Why will this not work, does anyone have an idea?
Thank you,
Darkhat
Code:
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open _
"Provider = Microsoft.Jet.OLEDB.4.0; " & _
"Data Source = CurrentDB" 'Location of Current database
objRecordSet.Open "SELECT * FROM Answers1", _
objConnection, adOpenStatic, adLockOptimistic
Set objFSO = CreateObject("Scripting.FileSystemObject") 'Create FOS Object
Set objFile = objFSO.OpenTextFile(strFilepath) 'Open file to Import
Thank you,
Darkhat