How to convert DBGrid database information to text files with VB 6

5 pts.
Tags:
Data conversion
Database programming
DBGrid
Visual Basic
Visual Basic 6
how to convert dbgrid database information in to text files (vb 6.0)

Answer Wiki

Thanks. We'll let you know when a new response is added.

in VB programme create all text variable like grid coloumn, all variable type is text.
and then type following code

i.e. in grid their r 4 col.

srno as string * [20]
name as string * [50]
Addr as string * [90]
mobile as string * [10]

dim i

fopen (“c:\result.txt”)

for i=0 to dbgrid.rows-1

srno = lset(dbgrid.textmatrix(i,0))
name =lset(dbgrid.textmatrix(i,1))
Addr =lset(dbgrid.textmatrix(i,2))
mobile =lset(dbgrid.textmatrix(i,3))

fwrite #, srno & name & Addr & mobile

next
fclose()

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following