export from a datagrid 
Author Message
 export from a datagrid
Getting desparate!!

This is the situation. As I open a Form a DateGrid containing data appears.
(4 columns, about 24 rows). Everything works fine. On the bottom of the Form
there is a command-button. The action of clicking the button should be
printing the contents of column 2, 3 and 4 of the datagrid to a textfile.

Can anyone give me a clue or give me some code?
Thanks

Sjoerd van Otten



Sun, 06 Jan 2002 03:00:00 GMT
 export from a datagrid

Quote:
>This is the situation. As I open a Form a DateGrid containing data appears.
>(4 columns, about 24 rows). Everything works fine. On the bottom of the
Form
>there is a command-button. The action of clicking the button should be
>printing the contents of column 2, 3 and 4 of the datagrid to a textfile.

>Can anyone give me a clue or give me some code?
>Thanks

I don't speak English so god and maybe I didn'n understund your problem but
maybe this can help you:

Sub Data_In_FilePrint
'If no records in Data1 then dont do this
If Data1.Recordset.BOF And Data1.Recordset.EOF Then Exit Sub
Data1.Recordset.Move First
Open "MyText.txt" For Output as #1 'Opening txt file
Do While Not Data1.Recordset.EOF
    Print #1, Data1.recordset(DBgrid1.Column(1).DataField);
    Print #1, Data1.recordset(DBgrid1.Column(2).DataField);
    Print #1, Data1.recordset(DBgrid1.Column(3).DataField)
    Data1.Recordset.MoveNext
Loop
Close #1
Data1.recordset.moveFirst
End Sub

    'If you know name of Data Field you may use this
    'Print #1, Data1.Recordset!MyRecord1;



Sun, 06 Jan 2002 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. export from datagrid

2. DTS Export: How to have nulls export as blanks on fixed width export

3. Copy from Datagrid to datagrid

4. Updating datagrid with requery, datagrid goes to top

5. export data from 8i using 7.3.4 export utility

6. to prevent loss of accented characters in exports, export to HTML

7. export file problem - how to close/unuse the exported file

8. exporting database did not export default column values

9. export contents into a file w/o using export

10. Newbie : How to export a big DB (~60GB) (like Oracle export)

11. DTS Export does not export all FK props???

12. Export/export/sequence Oracle8


 
Powered by phpBB® Forum Software