S
Ski
I am trying to save a MS Project File to MS Access based on user input,
thus i can't specify an exact path. I need to save the data from
Project to Access (using FileSaveAs), then create a query and paste to
Excel (using an ADO connection). Here is the piece of code that does
not work. Thanks in advance:
'FileSaveAs is a problem, I get a run-time error 1101 - Value is not
Valid
FileSaveAs Name:="<" & AccessFName & "<\" & ProjectFName,
FormatID:="MSProject.MDB8"
FileExit (pjDoNotSave)
'Connect to DB
Dim ConnDB As ADODB.Connection
Dim rstDB As ADODB.Recordset
Dim strSQL As String
Dim strSQL2 As String
Set ConnDB = New ADODB.Connection
Set rstDB = New ADODB.Recordset
ConnDB.Provider = "Microsoft.Jet.OLEDB.4.0;"
'The ConnectionString is a problem, it only wants to read a path, not
the string i pass to it
ConnDB.ConnectionString = "Data Source=AccessFName"
The rest of the code works fine. just need to work this out so i can
accept any user's input.
Thanks.
thus i can't specify an exact path. I need to save the data from
Project to Access (using FileSaveAs), then create a query and paste to
Excel (using an ADO connection). Here is the piece of code that does
not work. Thanks in advance:
'FileSaveAs is a problem, I get a run-time error 1101 - Value is not
Valid
FileSaveAs Name:="<" & AccessFName & "<\" & ProjectFName,
FormatID:="MSProject.MDB8"
FileExit (pjDoNotSave)
'Connect to DB
Dim ConnDB As ADODB.Connection
Dim rstDB As ADODB.Recordset
Dim strSQL As String
Dim strSQL2 As String
Set ConnDB = New ADODB.Connection
Set rstDB = New ADODB.Recordset
ConnDB.Provider = "Microsoft.Jet.OLEDB.4.0;"
'The ConnectionString is a problem, it only wants to read a path, not
the string i pass to it
ConnDB.ConnectionString = "Data Source=AccessFName"
The rest of the code works fine. just need to work this out so i can
accept any user's input.
Thanks.