Hello. I'm trying to export export a query result into a text file (not using a link to a text file) and it's returning me an error message saying that it cannot find the object. I have this: DoCmd.TransferText acExportDelim, "SupplierOrderHeader", "21", ("C:\Teste.txt") And it returns me this error: "The Microsoft Jet database engine could find the object 'Teste.txt'. Make sure tha object exists and that you spell its name and path name correctly." It's strange because I already did this in another batabase and it's working pretty well. I also tried to link access to a text file and then using a Append query to insert que results into that text file but is not working. But the most strange thing is that if I run the query as a select query it show me everything ok. I need this: 2402006|2006-04-17||N||| and is happening me this: 2412006|2006-02452006|2006-04-17||N||| Can somebody help me?? Regards, Marco
Remove the parentheses from around "C:\Teste.txt". -- Ken Snell <MS ACCESS MVP> "Marco" wrote in message news:CE49372D-C6F6-41E0-8CAD-FCEB33B1884D@microsoft.com... > Hello. > > I'm trying to export export a query result into a text file (not using a > link to a text file) and it's returning me an error message saying that it > cannot find the object. > > I have this: > DoCmd.TransferText acExportDelim, "SupplierOrderHeader", "21", > ("C:\Teste.txt") > > And it returns me this error: > "The Microsoft Jet database engine could find the object 'Teste.txt'. Make > sure tha object exists and that you spell its name and path name > correctly." > > It's strange because I already did this in another batabase and it's > working > pretty well. > > I also tried to link access to a text file and then using a Append query > to > insert que results into that text file but is not working. > > But the most strange thing is that if I run the query as a select query it > show me everything ok. > > I need this: > 2402006|2006-04-17||N||| > > and is happening me this: > 2412006|2006-02452006|2006-04-17||N||| > > > Can somebody help me?? > > Regards, > Marco >
Hi. It returns me the same error. What's happening here? Regards, Marco "Ken Snell (MVP)" wrote: > Remove the parentheses from around "C:\Teste.txt". > > -- > > Ken Snell > <MS ACCESS MVP> > > > "Marco" wrote in message > news:CE49372D-C6F6-41E0-8CAD-FCEB33B1884D@microsoft.com... > > Hello. > > > > I'm trying to export export a query result into a text file (not using a > > link to a text file) and it's returning me an error message saying that it > > cannot find the object. > > > > I have this: > > DoCmd.TransferText acExportDelim, "SupplierOrderHeader", "21", > > ("C:\Teste.txt") > > > > And it returns me this error: > > "The Microsoft Jet database engine could find the object 'Teste.txt'. Make > > sure tha object exists and that you spell its name and path name > > correctly." > > > > It's strange because I already did this in another batabase and it's > > working > > pretty well. > > > > I also tried to link access to a text file and then using a Append query > > to > > insert que results into that text file but is not working. > > > > But the most strange thing is that if I run the query as a select query it > > show me everything ok. > > > > I need this: > > 2402006|2006-04-17||N||| > > > > and is happening me this: > > 2412006|2006-02452006|2006-04-17||N||| > > > > > > Can somebody help me?? > > > > Regards, > > Marco > > > > >
Then I'd say your file C:\Teste.txt does not exist. Check the path and name of the file. -- Ken Snell <MS ACCESS MVP> "Marco" wrote in message news:052F53C8-1C21-4754-9817-6A9EB5BE0127@microsoft.com... > Hi. > > It returns me the same error. > > What's happening here? > > Regards, > Marco > > > > "Ken Snell (MVP)" wrote: > >> Remove the parentheses from around "C:\Teste.txt". >> >> -- >> >> Ken Snell >> <MS ACCESS MVP> >> >> >> "Marco" wrote in message >> news:CE49372D-C6F6-41E0-8CAD-FCEB33B1884D@microsoft.com... >> > Hello. >> > >> > I'm trying to export export a query result into a text file (not using >> > a >> > link to a text file) and it's returning me an error message saying that >> > it >> > cannot find the object. >> > >> > I have this: >> > DoCmd.TransferText acExportDelim, "SupplierOrderHeader", "21", >> > ("C:\Teste.txt") >> > >> > And it returns me this error: >> > "The Microsoft Jet database engine could find the object 'Teste.txt'. >> > Make >> > sure tha object exists and that you spell its name and path name >> > correctly." >> > >> > It's strange because I already did this in another batabase and it's >> > working >> > pretty well. >> > >> > I also tried to link access to a text file and then using a Append >> > query >> > to >> > insert que results into that text file but is not working. >> > >> > But the most strange thing is that if I run the query as a select query >> > it >> > show me everything ok. >> > >> > I need this: >> > 2402006|2006-04-17||N||| >> > >> > and is happening me this: >> > 2412006|2006-02452006|2006-04-17||N||| >> > >> > >> > Can somebody help me?? >> > >> > Regards, >> > Marco >> > >> >> >>
I wouldn't think that the file needs to preexist in order to be able to export to it. More likely is that Marco doesn't have permission to write to the root of C:\ -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Ken Snell (MVP)" <kthsneisllis9@ncoomcastt.renaetl> wrote in message news:%23jX9ajc3IHA.5088@TK2MSFTNGP03.phx.gbl... > Then I'd say your file C:\Teste.txt does not exist. Check the path and > name of the file. > > -- > > Ken Snell > <MS ACCESS MVP> > > > "Marco" wrote in message > news:052F53C8-1C21-4754-9817-6A9EB5BE0127@microsoft.com... >> Hi. >> >> It returns me the same error. >> >> What's happening here? >> >> Regards, >> Marco >> >> >> >> "Ken Snell (MVP)" wrote: >> >>> Remove the parentheses from around "C:\Teste.txt". >>> >>> -- >>> >>> Ken Snell >>> <MS ACCESS MVP> >>> >>> >>> "Marco" wrote in message >>> news:CE49372D-C6F6-41E0-8CAD-FCEB33B1884D@microsoft.com... >>> > Hello. >>> > >>> > I'm trying to export export a query result into a text file (not using >>> > a >>> > link to a text file) and it's returning me an error message saying >>> > that it >>> > cannot find the object. >>> > >>> > I have this: >>> > DoCmd.TransferText acExportDelim, "SupplierOrderHeader", "21", >>> > ("C:\Teste.txt") >>> > >>> > And it returns me this error: >>> > "The Microsoft Jet database engine could find the object 'Teste.txt'. >>> > Make >>> > sure tha object exists and that you spell its name and path name >>> > correctly." >>> > >>> > It's strange because I already did this in another batabase and it's >>> > working >>> > pretty well. >>> > >>> > I also tried to link access to a text file and then using a Append >>> > query >>> > to >>> > insert que results into that text file but is not working. >>> > >>> > But the most strange thing is that if I run the query as a select >>> > query it >>> > show me everything ok. >>> > >>> > I need this: >>> > 2402006|2006-04-17||N||| >>> > >>> > and is happening me this: >>> > 2412006|2006-02452006|2006-04-17||N||| >>> > >>> > >>> > Can somebody help me?? >>> > >>> > Regards, >>> > Marco >>> > >>> >>> >>> > >
"Douglas J. Steele" wrote in message news:%233vg9hh3IHA.3544@TK2MSFTNGP06.phx.gbl... >I wouldn't think that the file needs to preexist in order to be able to >export to it. Ah yes.... I was mistakenly writing an answer for an import... musta been a different post that was stuck in my memory :-) > > More likely is that Marco doesn't have permission to write to the root of > C:\ I concur. -- Ken Snell <MS ACCESS MVP>
Hello. Actually I'm the administrator, I have full access to the drive. I did another exportation with a diferent query and text file and it worked perfectly. Strange. But I solved the problem by exporting the table to a text file saving the definitions and then I used those definitions to export the file automatically. Thanks. Marco "Ken Snell (MVP)" wrote: > "Douglas J. Steele" wrote in message > news:%233vg9hh3IHA.3544@TK2MSFTNGP06.phx.gbl... > >I wouldn't think that the file needs to preexist in order to be able to > >export to it. > > Ah yes.... I was mistakenly writing an answer for an import... musta been a > different post that was stuck in my memory :-) > > > > > More likely is that Marco doesn't have permission to write to the root of > > C:\ > > I concur. > -- > > Ken Snell > <MS ACCESS MVP> > > > > >