|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Access/VBA noob question
Hi guys,
I was wondering how you export a form out of access into a .txt file. if anyone has a clue let me know. I know that access supplies an automatic feature, but I'd like to go a bit further with this. Thanks, Jason |
|
#2
|
|||
|
|||
|
Have you tried using the export functionality in MS Access.
__________________
El éxito consiste en una serie de pequeñas victorias día a día MySQL, MS SQL, MS ACCESS, Oracle Database Manager - http://victorpendleton.net/products/psdviewer.html |
|
#3
|
|||
|
|||
|
Yeah, you can export a form into text, but I need to take the table data and put some special characters inbetween entries. That's the reason that I need to do the text export manually. Access allows you to do several exports, but none fit what I need. Thanks for taking the time to read. Hopefully, I'll get some ideas.
Jason |
|
#4
|
|||
|
|||
|
Do you have access to any third party tools such as Data Junction or the MS DTS tool? These tools will allow you to define transformations. You can also write a query with the data in the exported format and save the query results.
|
|
#5
|
|||
|
|||
|
i don't have access to those. All i have is visual studio and access. I doubt that I can get my hands on any other applications that would be of use.
|
|
#6
|
|||
|
|||
|
You could try writing a query to generate the output and export the query.
|
|
#7
|
|||
|
|||
|
Ok, I have the query that I would like to run. I'm now having trouble finding documentation on how to code the query into visual basic. Any help would be appreciated! Thanks.
|
|
#8
|
|||
|
|||
|
If you are familiar with Database Programming with Visual Basic this may help you.
PHP Code:
|
|
#9
|
|||
|
|||
|
I'm not too familiar with VB. I'm just starting, but have to do all of this in my project. Any clarification would be greatly appreciated!
|
|
#10
|
|||
|
|||
|
Try the code I posted above subsituting the MySQL code for MS Access.
|
|
#11
|
|||
|
|||
|
I could not get that code to work
In Access and VB I get an error from the { bracket in the mySQL code (or MS Access).
I'm stumped :-( |
|
#12
|
|||
|
|||
|
I would probably use VBA code from a form button to export to a file using the filesystem object. Add a reference to the Microsoft Scripting runtime. In the button click event, copy the forms recordsetclone to a temporary recordset. Create the filesystem object and set up your output file, then iterate through the recordset and create each text line from the data in the recordset and write each line out to the destination file.
|
|
#13
|
|||
|
|||
|
Can you post how you are making your VB to MS Access data connection?
|
|
#14
|
|||
|
|||
|
my database connection
Dim sDatabase As String
Dim daoDB As Database Dim daoRS As Recordset Private Sub cmdOpen_Click() Dim fField As Field sDatabase = "C;\file.mdb" Set daoDB = OpenDatabase(sDatabase) Set daoRS = daoDB.OpenRecordset("SELECT * FROM Transactions") Sorry it took me awhile to get back on the boards. Let me know what you think is the problem |
|
#15
|
|||
|
|||
|
Was the C;\file.mdb a mistype? What is the OpenDatabase function doing? This seems to be where the work is really ocurring.
|
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Access/VBA noob question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|