List Info

Thread: Re: Re:Exporting ACcess table to Excel Using VB6




Re: Re:Exporting ACcess table to Excel Using VB6
country flaguser name
United States
2008-03-25 23:29:58


Dear Steve,

Thanks a lot Steve.  As usual, your guidance help me solve my problem.

One more question if you don't mind, how to make the header in the spread sheet instead of field name, become the caption propety of the access database field name.

Here is the statement for the header (but using field name) quote from the sample program :

 ' Make the column headers.
   
   For col = 0 To rs.Fields.Count - 1
       ; excel_sheet.Cells(1, col + 1) = rs.Fields(col).Name
  ;  Next col

Thanks again for your kind help.

Regards

Taufik Mansur



----- Original Message ----
From: Steve Manser <smansertwcny.rr.com>
To: helpwithvbyahoogroups.com
Sent: Tuesday, March 25, 2008 10:13:51 AM
Subject: RE: [helpwithvb] Re:Exporting ACcess table to Excel Using VB6


>&gt; "Can I move the data directly from Access into Excel ?"

Yes we can. Here is a sample / example project for download:

http://vb-helper. com/index_ office.html

to...

http://vb-helper. com/index_ office.html# access

and then....

http://vb-helper. com/howto_ access_to_ excel.html

and also...

http://vb-helper. com/howto_ access_to_ excel_2.html

------------ -

>;> "..any advise on how to fill the Flexgrid ?"

Yes.
In this group's Files Section there are some VB-6 examples.

At least one is very basic, no extra fluff, and with the
included comments it should be well explained, and may
also include some 'best programming practices'.

If I recall, even I could follow along in the comments.

Also, in the Excel spread sheet we can do a 'Save-As CSV' file.

All The Best,
Steve

____________ _________ _________ _________ _
From: helpwithvbyahoogro ups.com
[mailto:helpwithvbyahoogro ups.com] On Behalf Of Anthony Padua
Sent: Monday, March 24, 2008 12:52 PM
To: helpwithvbyahoogro ups.com
Subject: [helpwithvb] Re: Exporting Access table to Excel Using VB6

Write it as a file with the extension .csv  Use commas as column seperators,
and carriage returns as row separators.  Suppose you have a flexgrid by the
name of grid:

Open app.path & "myfile.csv" for output as 1

for row = 1 to grid.rows
 &nbsp; &nbsp; for column = 1 to grid.cols
 &nbsp;   &nbsp; &nbsp;  print #1, grid.textmatrix( row, column) & ","  'comma separates
columns
 &nbsp;   &nbsp; &nbsp;  print #1, vbcrlf&nbsp; 'carriage return tells it
'that it's at end of row
&nbsp; &nbsp; next column
next row

close

Now the spreadsheet can be opened and read by anyone.

.




Never miss a thing. Make Yahoo your homepage.

__._,_.___
.

__,_._,___
RE: Exporting Access table to Excel Using VB6
country flaguser name
United States
2008-03-26 16:36:52


Happy I could help Taufik.

Not sure I can answer this current question, but
I do seem to recall reading, somewhere, that there
was a way to combine the top row of cells on the
Excel Sheet to make one long cell, for a title/caption.

Then again, I may be confusing Word with Excel < g >

In re-reading your question, maybe I got it wrong
the first time around. Do you want to use something
else besides the Access Table Field Names in Excel ?

Do you want to make your own Column Names and place them ?

We could do that by filling a 1-D array with
the names we have created and placed into the array:

Name the array 'ColumnNames()'

' Make the column headers.

For col = 0 To rs.Fields.Count - 1
excel_sheet.Cells(1, col + 1) = ColumnNames(col)
Next col

...or do I still not see the problem correctly ?

Thanks,
Steve
'
Sent Out Around
17:35 EST on Wednesday, March 26, 2008
'
________________________________________
From: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
[mailto: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com] On Behalf Of Taufik Mansur
Sent: Wednesday, March 26, 2008 12:30 AM
To: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
Subject: Re: [helpwithvb] Exporting Access table to Excel Using VB6

Dear Steve,

Thanks a lot Steve.  As usual, your guidance help me solve my problem.

One more question if you don't mind, how to make the header in the spread
sheet instead of field name, become the caption property of the access
database field name.

Here is the statement for the header (but using field name) quote from the
sample program :

 ' Make the column headers.
   
   For col = 0 To rs.Fields.Count - 1
        excel_sheet.Cells(1, col + 1) = rs.Fields(col).Name
    Next col

Thanks again for your kind help.

Regards

Taufik Mansur

----- Original Message ----
From: Steve Manser < smanser%40twcny.rr.com">smansertwcny.rr.com>
To: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
Sent: Tuesday, March 25, 2008 10:13:51 AM
Subject: RE: [helpwithvb] Re:Exporting ACcess table to Excel Using VB6

&gt;> "Can I move the data directly from Access into Excel ?"

Yes we can. Here is a sample / example project for download:

http://vb-helper. com/index_ office.html

to...

http://vb-helper. com/index_ office.html# access

and then....

http://vb-helper. com/howto_ access_to_ excel.html

and also...

http://vb-helper. com/howto_ access_to_ excel_2.html

------------ -

>;> "..any advise on how to fill the Flexgrid ?"

Yes.
In this group's Files Section there are some VB-6 examples.

At least one is very basic, no extra fluff, and with the
included comments it should be well explained, and may
also include some 'best programming practices'.

If I recall, even I could follow along in the comments.

Also, in the Excel spread sheet we can do a 'Save-As CSV' file.

All The Best,
Steve

____________ _________ _________ _________ _
From: helpwithvbyahoogro ups.com
[mailto:helpwithvbyahoogro ups.com] On Behalf Of Anthony Padua
Sent: Monday, March 24, 2008 12:52 PM
To: helpwithvbyahoogro ups.com
Subject: [helpwithvb] Re: Exporting Access table to Excel Using VB6

Write it as a file with the extension .csv  Use commas as column seperators,
and carriage returns as row separators.  Suppose you have a flexgrid by the
name of grid:

Open app.path & "myfile.csv"; for output as 1

for row = 1 to grid.rows
     for column = 1 to grid.cols
          print #1, grid.textmatrix( row, column) & ",&quot;  'comma separates
columns
          print #1, vbcrlf  'carriage return tells it
'that it's at end of row
    next column
next row

close

Now the spreadsheet can be opened and read by anyone.

.

__._,_.___
.

__,_._,___
RE: Exporting Access table to Excel Using VB6
country flaguser name
United States
2008-03-27 07:00:06

Probably wants to do something like this:

 

GetCaption = dbs.TableDefs(strTableName).Fields(strField).Properties("caption&quot;)
 
/tr
 

 

 


From: helpwithvbyahoogroups.com [mailto:helpwithvbyahoogroups.com] On Behalf Of Steve Manser
Sent: Wednesday, March 26, 2008 5:37 PM
To: helpwithvbyahoogroups.com
Subject: RE: [helpwithvb] Exporting Access table to Excel Using VB6

 


Happy I could help Taufik.

Not sure I can answer this current question, but
I do seem to recall reading, somewhere, that there
was a way to combine the top row of cells on the
Excel Sheet to make one long cell, for a title/caption.

Then again, I may be confusing Word with Excel < g >

In re-reading your question, maybe I got it wrong
the first time around. Do you want to use something
else besides the Access Table Field Names in Excel ?

Do you want to make your own Column Names and place them ?

We could do that by filling a 1-D array with
the names we have created and placed into the array:

Name the array 'ColumnNames()'

' Make the column headers.

For col = 0 To rs.Fields.Count - 1
excel_sheet.Cells(1, col + 1) = ColumnNames(col)
Next col

...or do I still not see the problem correctly ?

Thanks,
Steve
'
Sent Out Around
17:35 EST on Wednesday, March 26, 2008
'
________________________________________
From: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
[mailto: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com] On Behalf Of Taufik Mansur
Sent: Wednesday, March 26, 2008 12:30 AM
To: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
Subject: Re: [helpwithvb] Exporting Access table to Excel Using VB6

Dear Steve,

Thanks a lot Steve.&nbsp; As usual, your guidance help me solve my problem.

One more question if you don't mind, how to make the header in the spread
sheet instead of field name, become the caption property of the access
database field name.

Here is the statement for the header (but using field name) quote from the
sample program :

&nbsp;' Make the column headers.
 &nbsp; 
 &nbsp; For col = 0 To rs.Fields.Count - 1
   ; &nbsp; &nbsp; excel_sheet.Cells(1, col + 1) = rs.Fields(col).Name
   ; Next col

Thanks again for your kind help.

Regards

Taufik Mansur

----- Original Message ----
From: Steve Manser < smanser%40twcny.rr.com">smansertwcny.rr.com>
To: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
Sent: Tuesday, March 25, 2008 10:13:51 AM
Subject: RE: [helpwithvb] Re:Exporting ACcess table to Excel Using VB6

&gt;> "Can I move the data directly from Access into Excel ?"

Yes we can. Here is a sample / example project for download:

http://vb-helper. com/index_ office.html

to...

http://vb-helper. com/index_ office.html# access

and then....

http://vb-helper. com/howto_ access_to_ excel.html

and also...

http://vb-helper. com/howto_ access_to_ excel_2.html

------------ -

>;> "..any advise on how to fill the Flexgrid ?"

Yes.
In this group's Files Section there are some VB-6 examples.

At least one is very basic, no extra fluff, and with the
included comments it should be well explained, and may
also include some 'best programming practices'.

If I recall, even I could follow along in the comments.

Also, in the Excel spread sheet we can do a 'Save-As CSV' file.

All The Best,
Steve

____________ _________ _________ _________ _
From: helpwithvbyahoogro ups.com
[mailto:helpwithvbyahoogro ups.com] On Behalf Of Anthony Padua
Sent: Monday, March 24, 2008 12:52 PM
To: helpwithvbyahoogro ups.com
Subject: [helpwithvb] Re: Exporting Access table to Excel Using VB6

Write it as a file with the extension .csv  Use commas as column seperators,
and carriage returns as row separators.  Suppose you have a flexgrid by the
name of grid:

Open app.path & "myfile.csv"; for output as 1

for row = 1 to grid.rows
 &nbsp; &nbsp; for column = 1 to grid.cols
 &nbsp;   &nbsp; &nbsp;  print #1, grid.textmatrix( row, column) & ",&quot;  'comma separates
columns
 &nbsp;   &nbsp; &nbsp;  print #1, vbcrlf&nbsp; 'carriage return tells it
'that it's at end of row
&nbsp; &nbsp; next column
next row

close

Now the spreadsheet can be opened and read by anyone.

.

__._,_.___
.

__,_._,___
RE: Exporting Access table to Excel Using VB6
country flaguser name
United States
2008-03-27 07:11:17



>;>> Probably wants to do something like....

Make one of your tee times !

That was a mighty fine, and kind offer Tim.

Sorry I was away and missed the chance.

Sorry I left before I saw the offer,
I would have switched dates with J-Lo

< g >

Steve

________________________________________
From: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
[mailto: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com] On Behalf Of Tim Rupp
Sent: Thursday, March 27, 2008 8:00 AM
To: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
Subject: RE: [helpwithvb] Exporting Access table to Excel Using VB6

Probably wants to do something like this:
 
GetCaption =
dbs.TableDefs(strTableName).Fields(strField).Properties(&quot;caption")
 
/tr
 
 .
.

__._,_.___
.

__,_._,___
RE: Exporting Access table to Excel Using VB6
country flaguser name
United States
2008-03-27 20:00:43

ROFLMAO230;

 

(since J-Lo was very pregnant with twins at that date…;hope you had a good time…;I did—shot 109!)

 

/tr

 

 


From: helpwithvbyahoogroups.com [mailto:helpwithvbyahoogroups.com] On Behalf Of Steve Manser
Sent: Thursday, March 27, 2008 8:11 AM
To: helpwithvbyahoogroups.com
Subject: RE: [helpwithvb] Exporting Access table to Excel Using VB6

 



>>> Probably wants to do something like....

Make one of your tee times !

That was a mighty fine, and kind offer Tim.

Sorry I was away and missed the chance.

Sorry I left before I saw the offer,
I would have switched dates with J-Lo

< g >

Steve

________________________________________
From: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
[mailto: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com] On Behalf Of Tim Rupp
Sent: Thursday, March 27, 2008 8:00 AM
To: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
Subject: RE: [helpwithvb] Exporting Access table to Excel Using VB6

Probably wants to do something like this:
&nbsp;
GetCaption =
dbs.TableDefs(strTableName).Fields(strField).Properties(&quot;caption")
 
/tr
 
 .
.

__._,_.___
.

__,_._,___
RE: Exporting Access table to Excel Using VB6
country flaguser name
United States
2008-03-27 23:31:56


>&gt; shot 109

Damn !

You would have had me down by a bunch

But, it’s the good times that count.
How much fun was the 18th ?

I did look at the course, online.

Steve
________________________________________
From: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
[mailto: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com] On Behalf Of Tim Rupp
Sent: Thursday, March 27, 2008 9:01 PM
To: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
Subject: RE: [helpwithvb] Exporting Access table to Excel Using VB6

ROFLMAO…
 
(since J-Lo was very pregnant with twins
at that date…hope you had a good time…I did—shot 109!)
 
/tr
 
 
________________________________________
From: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
[mailto: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com] On Behalf Of Steve Manser
Sent: Thursday, March 27, 2008 8:11 AM
To: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
Subject: RE: [helpwithvb] Exporting Access table to Excel Using VB6
 

>>> Probably wants to do something like....

Make one of your tee times !

That was a mighty fine, and kind offer Tim.

Sorry I was away and missed the chance.

Sorry I left before I saw the offer,
I would have switched dates with J-Lo

< g >

Steve

________________________________________
From: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
[mailto: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com] On Behalf Of Tim Rupp
Sent: Thursday, March 27, 2008 8:00 AM
To: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
Subject: RE: [helpwithvb] Exporting Access table to Excel Using VB6

Probably wants to do something like this:
 
GetCaption =
dbs.TableDefs(strTableName).Fields(strField).Properties(&quot;caption")
 
/tr
 
 .
.

__._,_.___
.

__,_._,___
[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )