Hi All
Can any one please help me in problem.I want to export details of a access table to a csv file
for that i have written the following code
filepath = "\\accs03-003fs\Databases\Development\ACCFIN_Group_Sales\v2. 0 Development\filename"
DoCmd.TransferText acExportDelim, , "tab_Customers", filepath
but after executing the above command i am getting "Cannot update database or Object is read only".Why is it so..
then one more doubt is that can i export a result of a query to csv file rather than table name.Thanks in advance
5 5720
Hi All
Can any one please help me in problem.I want to export details of a access table to a csv file
for that i have written the following code
filepath = "\\accs03-003fs\Databases\Development\ACCFIN_Group_Sales\v2. 0 Development\filename"
DoCmd.TransferText acExportDelim, , "tab_Customers", filepath
but after executing the above command i am getting "Cannot update database or Object is read only".Why is it so..
I believe the problem is deriving from your filepath. I would suggest designing a macro that transfers text first. I find it easier to troubleshoot problems using macros, then migrate your finds to code.
Hope this points you in the right direction,
Bender
- Function test()
-
Dim db As dao.Database
-
Set db = CurrentDb
-
-
Dim strTemp As String
-
-
strTemp = "C:\Database\test.csv"
-
-
-
DoCmd.OutputTo acOutputTable, "TableName", acFormatXLS, strTemp, 1
-
-
'Save the workbook
-
Dim strSavePath As String
-
Dim strFileNm As String
-
strSavePath = "C:\Database\Example.xls"
-
-
xlApp.ActiveWorkbook.SaveAs strSavePath
-
-
'Close Excel
-
xlApp.Quit
-
Set xlApp = Nothing
-
-
-
End Function
Hi
Thanks for reply..what is the object xlApp refered,is it excel object
Function test()
Dim db As dao.Database
Set db = CurrentDb
Dim strTemp As String
strTemp = "C:\Database\test.csv"
DoCmd.OutputTo acOutputTable, "TableName", acFormatXLS, strTemp, 1
'Save the workbook
Dim strSavePath As String
Dim strFileNm As String
strSavePath = "C:\Database\Example.xls"
xlApp.ActiveWorkbook.SaveAs strSavePath
'Close Excel
xlApp.Quit
Set xlApp = Nothing
End Function
NeoPa 32,556
Expert Mod 16PB
It's the Excel application.
After a closer look though, it may need some extra code to set it up before use. Check out Application Automation for what you may need to add for this to work.
NeoPa 32,556
Expert Mod 16PB
Function test()
Dim db As dao.Database
Set db = CurrentDb
...
'Close Excel
xlApp.Quit
Set xlApp = Nothing
End Function
Cori, I've noticed a number of your helpful responses in the forum, so I don't want to sound critical.
Please remember to use the [ CODE ] tags in future when including code in your posts. I've updated this one for you.
Welcome to TheScripts & keep up the good work :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: DarkSpy |
last post by:
many c++ compilers including "gcc" have not implemented the "export"
keyword, but the comeau compilers made it (just i knew).
i want to know about: is it too difficult to implement "export"...
|
by: Shawn Mehaffie |
last post by:
I have the following class that I've wirtten to take a Dataset and
automatically export it to either XML, ASCII or Tab delimited file. The
reason I wrote it they way I did was that I don't want to...
|
by: Jeremy Siek |
last post by:
CALL FOR PAPERS/PARTICIPATION
C++, Boost, and the Future of C++ Libraries
Workshop at OOPSLA
October 24-28, 2004
Vancouver, British Columbia, Canada
http://tinyurl.com/4n5pf
Submissions
|
by: maricel |
last post by:
Is there anybody out there who have any idea why EXPORT is relatively slower
when putting the output file on a network drive - map drive from onother PC
compared to putting it on my local PC drive...
|
by: Tim Eliot |
last post by:
Just wondering if anyone has hit the following issue and how you might
have sorted it out.
I am using the command:
DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True
after...
|
by: Shawn Mehaffie |
last post by:
I have the following class that I've wirtten to take a Dataset and automatically export it to either XML, ASCII or Tab delimited file. The reason I wrote it they way I did was that I don't want to...
|
by: chaitu |
last post by:
Hi,
Can anybody tell me what the error code for Export is. Like i get the
message
SQL3104N The Export utility is beginning to export data to file...
|
by: Steven T. Hatton |
last post by:
<quote
url="http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=53&rl=1">
exported Templates
Last updated Sep 6, 2006.
exported Templates
The separate compilation model enables...
|
by: NEWSGROUPS |
last post by:
I have data in a table in an Access 2000 database that needs to be exported
to a formatted text file. For instance, the first field is an account number
that is formatted in the table as text and...
|
by: iheartvba |
last post by:
Hi I am using Access 2007 and am trying to export a query to a fixed length text file. I tried using the following code to export the text file:
DoCmd.TransferText acExportFixed, , "qryFFRDeFile",...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
| |