Solved

SQL Server 2008 GetRows Error

Posted on 2013-11-17
2
486 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

11 Experts available now in Live!

Get 1:1 Help Now