Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Bill Gates
 
Posts: n/a
Default

Thanks for the reply...

I get my data using the following code....

' set the connection string for the QueryTable
Sheets("Data").Range("VI").QueryTable.Connection = sSQLConn

' set the stored procedure to run
Sheets("Data").Range("VI").QueryTable.CommandText = "EXEC GetInformation" & sParameters

' execute the refresh of the data
Sheets("Data").Range("VI").QueryTable.Refresh BackgroundQuery:=False

Hope this helps

Bill
"Fredrik Wahlgren" wrote in message ...

"Bill Gates" wrote in message ...
Hello All,

I have a problem, I am sure that everyone in here has had this problem and I was hoping for some help to solve it.
I have checked the groups for a solution but was unable to find anything suitable.

Anyway on to the issue....

I have a datarange which retreives information from a SQL Server 2000 database, everything works fine when there is a lot or records returned, the problem occurs when just one record is returned.

I am doing a "DataRange.Rows.Count" which returns the correct number for large number of rows but returns 3 for just 1 row (i would have expected 2 as i have headers turn on)

see screen shot - the highlighted region is the datarange with one row return, as you can see there is a blank row under the return record. any ideas as to how to not return this record?



Thanks

Bill

How do you get your data? I guess DataRange.Rows.Count returns the size of the datarange which may be different from the number of records you get. If you use ADO, there's a property that tells you how many records you got.

/Fredrik
  #2   Report Post  
Bill Gates
 
Posts: n/a
Default Extra Record in Data Range

Hello All,

I have a problem, I am sure that everyone in here has had this problem and I was hoping for some help to solve it.
I have checked the groups for a solution but was unable to find anything suitable.

Anyway on to the issue....

I have a datarange which retreives information from a SQL Server 2000 database, everything works fine when there is a lot or records returned, the problem occurs when just one record is returned.

I am doing a "DataRange.Rows.Count" which returns the correct number for large number of rows but returns 3 for just 1 row (i would have expected 2 as i have headers turn on)

see screen shot - the highlighted region is the datarange with one row return, as you can see there is a blank row under the return record. any ideas as to how to not return this record?



Thanks

Bill
  #3   Report Post  
Fredrik Wahlgren
 
Posts: n/a
Default


"Bill Gates" wrote in message ...
Hello All,

I have a problem, I am sure that everyone in here has had this problem and I was hoping for some help to solve it.
I have checked the groups for a solution but was unable to find anything suitable.

Anyway on to the issue....

I have a datarange which retreives information from a SQL Server 2000 database, everything works fine when there is a lot or records returned, the problem occurs when just one record is returned.

I am doing a "DataRange.Rows.Count" which returns the correct number for large number of rows but returns 3 for just 1 row (i would have expected 2 as i have headers turn on)

see screen shot - the highlighted region is the datarange with one row return, as you can see there is a blank row under the return record. any ideas as to how to not return this record?



Thanks

Bill

How do you get your data? I guess DataRange.Rows.Count returns the size of the datarange which may be different from the number of records you get. If you use ADO, there's a property that tells you how many records you got.

/Fredrik
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
enter data on 1 sheet and make it enter on next avail row on 2nd s Nadia Excel Discussion (Misc queries) 27 September 9th 05 03:39 PM
Help with data not getting plotted Scott Ehrlich Excel Discussion (Misc queries) 2 January 25th 05 05:17 AM
How do I search a data range for a particular value then collate . Hulkascooby Excel Discussion (Misc queries) 0 January 19th 05 03:21 PM
extend data range formats and formulas Lonnie Setting up and Configuration of Excel 1 December 10th 04 11:33 PM
Extending a Chart Data Series from an Array - Can it be done? Jon Peltier Charts and Charting in Excel 4 November 30th 04 03:30 AM


All times are GMT +1. The time now is 12:44 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"