Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Using "GetString"

Hello, I am using Excel XP with Win 2000 and ADO 2.5.

1) When converting an ADO recordset into a string using "GetString", does
anyone know of any bugs, row limitations, length or size restrictions, etc.
with this method?

I'm considering using this method for importing data when there is too much
to fit into an Excel sheet. Alternatively, I will port the data into a CSV
text file and I just wanted to know how stable this method is. I would use
the syntax shown below:

rsADO.GetString(adClipString, , ",", vbCr)

2) Also, does anyone know if this method automatically (internally)
surrounds each column with double quotation marks? If not how can I get it to
do this? Please illustrate the syntax.

Thanks much in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Using "GetString"

quartz wrote ...

I'm considering using this method for importing data when there is too much
to fit into an Excel sheet.
Alternatively, I will port the data into a CSV text file


GetString may not be the best way of creating a csv file. Jet's
SELECT..INTO syntax is better and puts in the double quotes where
appropriate.

If your ADO is a Jet data source (.xls, .mdb, etc) you just need to
insert an INTO clause e.g. if your sql text looks like this:

SELECT MyTextCol
FROM MyTable;

then change it to something like this:

SELECT MyTextCol
INTO
[Text;HDR=YES;Database=C:\MyFolder\;].MyFile#csv
FROM MyTable;

If you are using a non-Jet data source you may be able to use the same
trick by opening a connection to a Jet source (e.g. a nonexistent
..xls) and putting an odbc connection to you actual data source in the
sql text e.g. for SQL Server data source:

SELECT lname AS MyTextCol
INTO
[Text;HDR=YES;Database=C:\MyFolder\;].MyFile#csv
FROM
[ODBC;Driver={SQL
Server};SERVER=MYSERVER;DATABASE=pubs;UID=***;Pwd= ***;].employee;

Jamie.

--
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Using "GetString" with ADO quartz[_2_] Excel Programming 3 October 18th 04 12:19 PM


All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"