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" with ADO

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: 15
Default Using "GetString" with ADO

I haven't used GetString myself, but I use getRows a lot to write a
recordset into an array

Dim arrRs as variant
arrRs = rsAdo.getRows

You can then write the array to the spreadsheet (you'll need to convert it
from base 0 to base 1) or write it to a text file.

Let me know if you need further code to do this.

Regards,
Wayne C.

"quartz" wrote in message
...
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.



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

"The Vision Thing" wrote ...

I haven't used GetString myself, but I use getRows a lot to write a
recordset into an array
You can then write the array to the spreadsheet (you'll need to convert it
from base 0 to base 1)


There is no need to convert the array. To test:

Sub test()

Dim rs As Object
Set rs = CreateObject("ADODB.Recordset")

With rs
.CursorLocation = 3
.Fields.Append "Col1", 12
.Fields.Append "Col2", 12

.Open

.AddNew _
Array("Col1", "Col2"), _
Array("A1", "A2")

.AddNew _
Array("Col1", "Col2"), _
Array("B1", "B2")

.AddNew _
Array("Col1", "Col2"), _
Array("C1", "C2")

.Update

Dim vntArray As Variant
.MoveFirst
vntArray = .GetRows

.Close

End With

' Prove it's a base zero array
MsgBox vntArray(0, 0)

' Write base zero array to Range
Sheet1.Range("A1:C2").Value = vntArray

End Sub


Jamie.

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

"The Vision Thing" wrote ...

I use getRows a lot to write a
recordset into an array
You can then write the array to the spreadsheet (you'll need to convert it
from base 0 to base 1)


By amazing coincidence, on an unrealted matter I just turned up this
thread from the archive:

http://groups.google.com/groups?thre...gp13.phx .gbl

Tom Ogilvy was correct: no problem writing a base 0 array to a Range.
You replied, "I believe you cannot directly write an array to a
spreadsheet range
unless it is base(1)" and no one at the time reasserted that your
assumption was incorrect.

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
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM


All times are GMT +1. The time now is 03:38 PM.

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"