Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 28th, 2003, 03:35 PM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default convert string to integer

I'm trying to create an array that is the same size as the number of records in a table. I did a query to find out how many records are in the table, but when I create the array, I get the error "Expected integer constant"

Does anyone know how I can convert to an integer format? My code is below:

openrs rsSeverityCount, "SELECT Count(*) AS severityCount FROM severity;"
Dim severityLen : severityLen = rsSeverityCount("severityCount")
Dim arrDays(severityLen)
 
Old July 28th, 2003, 04:39 PM
Friend of Wrox
 
Join Date: May 2003
Posts: 202
Thanks: 0
Thanked 1 Time in 1 Post
Default

The parameter in a Dim statement must be a literal constant - variables are not allowed.

You could rearrange your code to use ReDim as follows:
Code:
openrs rsSeverityCount, "SELECT Count(*) AS severityCount FROM severity;"
Dim severityLen : severityLen = rsSeverityCount("severityCount")
Dim arrDays(0)

ReDim arrDays(severityLen)
Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.





Similar Threads
Thread Thread Starter Forum Replies Last Post
[Resolved] Convert Time to Integer snufse ASP.NET 2.0 Basics 1 October 7th, 2008 11:44 AM
convert web unit (pixels) to integer ubercat ASP.NET 1.0 and 1.1 Professional 0 August 8th, 2006 06:51 PM
Extracting an Integer from a string gjc VB How-To 2 September 13th, 2005 03:50 PM
Convert string from text box to integer ja8261 VB.NET 2002/2003 Basics 5 November 6th, 2004 10:04 PM
Converting String to an integer Louisa VB.NET 2002/2003 Basics 2 March 5th, 2004 10:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.