|
-
October 18th, 2006, 01:43 AM
#1
Save records from DBGrid to Txt File
Hi
I have an application that is connected with SQLServer 2000 and BCB6.
I have the records in DBGrid to saw them in my application.. My question is how i can save this records to txt file?? Any code ideas??
My fields are: Name and Size
So i want to save them in txt file.. Is possible that???
i did something like this
ADOTable1->SaveToFile("c:\\86.txt"); but is totally wrong because i want to save only the above 2 fields and all i get in this file is strange letters
Please help
-
October 18th, 2006, 09:58 AM
#2
Re: Save records from DBGrid to Txt File
Try "manually" looping on the records and writing the relevant values to the file the way you want. There probably isn't a one-line solution to this...
-
October 19th, 2006, 01:27 AM
#3
Re: Save records from DBGrid to Txt File
what you mean? Any code ideas???
-
October 23rd, 2006, 09:23 AM
#4
Re: Save records from DBGrid to Txt File
Following is what I meant expressed in semi-pseudo-code:
for (int i = 0; i < ADOTable1->RecordCount; i++)
{
Write to file the values you want, e.g.:
ADOTable1->FieldByName("Abc")->AsString + ", " + ADOTable1->FieldByName("Xyz")->AsString + ...
}
-
October 24th, 2006, 12:24 AM
#5
Re: Save records from DBGrid to Txt File
Ok seem good but how i am gonna write it in file. I mean you dont use file.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|