Discussion:
create xl file and copy data
(too old to reply)
balu
2008-09-09 14:34:01 UTC
Permalink
dear friends,
how create an excel file from front end vb6 and use "CopyfromRecordset"
method of VBA to out put an query into the excel file.
Sandip Kumar
2008-09-11 09:27:01 UTC
Permalink
Hi Balu,

First of all make a reference of Excel and ADODB object in VB

This is the code to export data to Excel

Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim exl As New Excel.Application
Dim wksht As New Excel.Worksheet
con.Open "DRIVER=SQL SERVER;SERVER=SANDIPKUMAR;UID=sa;PWD=m2m;APP=Microsoft
Visual FoxPro;WSID=SANDIPKUMAR;DATABASE=System"
con.CursorLocation = adUseClient
rs.Open "Select * from UtCurr", con, adOpenDynamic, adLockReadOnly
exl.Workbooks.Add
Set wksht = exl.Worksheets(1)
For iCols = 0 To rs.Fields.Count - 1
wksht.Cells(1, iCols + 1).Value = rs.Fields(iCols).Name
wksht.Cells(1, iCols + 1).Font.Bold = True
Next

wksht.Range("A2").CopyFromRecordset rs

exl.Visible = True

===================
Post by balu
dear friends,
how create an excel file from front end vb6 and use "CopyfromRecordset"
method of VBA to out put an query into the excel file.
balu
2008-09-13 08:40:00 UTC
Permalink
Post by Sandip Kumar
Hi Balu,
First of all make a reference of Excel and ADODB object in VB
This is the code to export data to Excel
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim exl As New Excel.Application
Dim wksht As New Excel.Worksheet
con.Open "DRIVER=SQL SERVER;SERVER=SANDIPKUMAR;UID=sa;PWD=m2m;APP=Microsoft
Visual FoxPro;WSID=SANDIPKUMAR;DATABASE=System"
con.CursorLocation = adUseClient
rs.Open "Select * from UtCurr", con, adOpenDynamic, adLockReadOnly
exl.Workbooks.Add
Set wksht = exl.Worksheets(1)
For iCols = 0 To rs.Fields.Count - 1
wksht.Cells(1, iCols + 1).Value = rs.Fields(iCols).Name
wksht.Cells(1, iCols + 1).Font.Bold = True
Next
wksht.Range("A2").CopyFromRecordset rs
exl.Visible = True
===================
Post by balu
dear friends,
how create an excel file from front end vb6 and use "CopyfromRecordset"
method of VBA to out put an query into the excel file.
balu
2008-09-13 08:54:02 UTC
Permalink
dear friends ;
how to run an access query(query built with in access using user defined
functions in access module)
from front end in vb6
or how to build same module in front end and use it to run the / build the
query
can i get your kind help ?
Post by Sandip Kumar
Hi Balu,
First of all make a reference of Excel and ADODB object in VB
This is the code to export data to Excel
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim exl As New Excel.Application
Dim wksht As New Excel.Worksheet
con.Open "DRIVER=SQL SERVER;SERVER=SANDIPKUMAR;UID=sa;PWD=m2m;APP=Microsoft
Visual FoxPro;WSID=SANDIPKUMAR;DATABASE=System"
con.CursorLocation = adUseClient
rs.Open "Select * from UtCurr", con, adOpenDynamic, adLockReadOnly
exl.Workbooks.Add
Set wksht = exl.Worksheets(1)
For iCols = 0 To rs.Fields.Count - 1
wksht.Cells(1, iCols + 1).Value = rs.Fields(iCols).Name
wksht.Cells(1, iCols + 1).Font.Bold = True
Next
wksht.Range("A2").CopyFromRecordset rs
exl.Visible = True
===================
Post by balu
dear friends,
how create an excel file from front end vb6 and use "CopyfromRecordset"
method of VBA to out put an query into the excel file.
tom_willpa
2010-01-01 18:35:01 UTC
Permalink
high quality Soccer jerseys NBA Jersey tracksuit and jackets, GHD
hairstraightener supplier from www.willpa.com

Are you a Retail businessman who bother by the purchase price? China
Cheapest TOP wholesale website can help you

we are specialize in replica sport goods manufacturing in china, we can
offer you all kinds of soccer jersey, NBA jersey,shoes and so on. they are
the best brand replica goods whih are look the same as the original goods.
excellent quality and steady supply for them. we have been marketed in Europe
and American for 3 year. all the goods we offer are AAA quality. our soccer
jersey are Thailand style. If any goods you buy from my company have problem,
we will refund or resend them again. Most of ourProducts have no minimum
order requirements,soyou can shop retail goods at wholesale prices. if you
can buy more than 300usd. We offer free shipping. The more you buy the more
discount for you.

National soccer jerseys: http://www.willpa.com
Club soccer jerseys: http://www.willpa.com
NBA Jerseys: http://www.willpa.com
T-shirt and shirt: http://www.willpa.com
Tracksuit: http://www.willpa.com
Hoody & Jackets: http://www.willpa.com
UGG boots: http://www.willpa.com
Hair style: http://www.willpa.com
shopping Index: http://www.willpa.com

EMS shipping. 7days arrive, paypal accept

want more information pls contact us or check our website: www.willpa.com
Loading...