Solved

SQL Server 2008 GetRows Error

Posted on 2013-11-17
2
490 Views
Last Modified: 2013-11-17
Trying to implement getrows for the first time and i am getting a type mismatch error:

Line: 94
Column: -1
Source:
Description: Type mismatch
Err #:
Com Err #: -2146828275
Category: Microsoft VBScript runtime

Here is where the error is occurring:
ReDim Preserve PartArray(11, 0)			
If lRaceID = "0" Then
	i = 0
'	For k = 0 to UBound(Races, 2) - 1
		Set rs = Server.CreateObject("ADODB.Recordset")
		sql="SELECT p.ParticipantID, p.FirstName, p.LastName, rc.Bib, p.Gender, rc.Age, p.City, p.St, p.Phone, p.DOB, p.Email, rg.RaceID FROM "
		sql = sql & "Participant p INNER JOIN PartReg rg ON p.ParticipantID = rg.ParticipantID JOIN PartRace rc "
		sql = sql & "ON rc.ParticipantID = p.ParticipantID WHERE rc.RaceID IN (" & sEventRaces & ") " & sOrderBy
		rs.Open sql, conn, 1, 2
        PartArray=rs.GetRows()		
        rs.Close
		Set rs=Nothing
'	Next

Open in new window


I have fiddled with the ReDim, etc and continue to get errors.
0
Comment
Question by:Bob Schneider
2 Comments
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 200 total points
ID: 39654714
Which line does the error refer to?

Get rid of, "ReDim Preserve PartArray(11, 0)      "

What is the purpose of the for next statement?  Are you trying to create multiple arrays?
0
 
LVL 32

Accepted Solution

by:
Big Monty earned 300 total points
ID: 39654717
No need to redim the array. Just do

Dim PartArray

Using GetRows well automatically size the array for you, no need to set the size of it
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
A short film showing how OnPage and Connectwise integration works.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now