snowmantle
Programmer
Hi,
I have an Access project file linked to an sql server database.
At the moment i have a form that you can use with combo boxes which will create a custom sql statement depending on what the user picks so that the sql can be used as the filter for an Access report.
The code for exporting the info is this:
So all i am doing is:
running the code to get the sql filter for the report which also opens the report
then a command to output the report to a .csv file
and then close the report after it is done.
The problem i have got at the moment is that a field in my report has data in it greater than 255 characters and when viewing the .csv in Excel you dont see more than 255 characters in the cells of that field.
Viewing the .csv using notepad also doesnt work well because Access has added lots of ascii characters around the information, which just makes it un-readable.
I was thinking of ways around this and one way when using a .mdb would of been to export the query directly instead of the report, as far as i am aware though you cant do it with a view in an sql database when using a .adp.
If i am wrong or someone knows a different way, please let me know.
I have an Access project file linked to an sql server database.
At the moment i have a form that you can use with combo boxes which will create a custom sql statement depending on what the user picks so that the sql can be used as the filter for an Access report.
The code for exporting the info is this:
Code:
CmdRunReport_Click
DoCmd.OutputTo acOutputReport, "Report1", acFormatXLS, "File location" & Format(Now(), "ddmmyyyy") & Format(Time(), "hhmmss") & ".csv", True
DoCmd.Close acReport, "Report1"
So all i am doing is:
running the code to get the sql filter for the report which also opens the report
then a command to output the report to a .csv file
and then close the report after it is done.
The problem i have got at the moment is that a field in my report has data in it greater than 255 characters and when viewing the .csv in Excel you dont see more than 255 characters in the cells of that field.
Viewing the .csv using notepad also doesnt work well because Access has added lots of ascii characters around the information, which just makes it un-readable.
I was thinking of ways around this and one way when using a .mdb would of been to export the query directly instead of the report, as far as i am aware though you cant do it with a view in an sql database when using a .adp.
If i am wrong or someone knows a different way, please let me know.