![]() |
FileSaveAs MS Project to MS Access
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. |
FileSaveAs MS Project to MS Access
"Data Source=" & AccessFName
would be my guess for number 2. I have never seen anthing like this: FileSaveAs Name:="<" & AccessFName & "<\" & ProjectFName, FormatID:="MSProject.MDB8" -- Regards, Tom Ogilvy "Ski" wrote in message oups.com... 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. |
All times are GMT +1. The time now is 03:03 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com