Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBScript runtime error: overflow

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1373
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBScript runtime error: overflow
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VBScript runtime error: overflow - 9/17/2004 10:53:54 AM   
  sslatimer

 

Posts: 4
Score: 0
Joined: 9/17/2004
From: USA
Status: offline
I am a new VB Script user. I have an ArcPad application where I am using forms and a VB Script to add points to a GIS data layer. The following error occurs as soon as I try to add a point:

Application Script Error 800A0006
Microsoft VBScript runtime error
Overflow; [Line: 1, Column: 1]
Source Text Unavailable.

This error occurs twice when I start to add a point feature to the layer. Once past the error windows the application seems to work fine. I have looked up the error on the Microsoft site but cannot figure out what I should fix. Apparently I am not using a variable correctly but cannot figure out which one or what I might be doing wrong. Anyone have suggestions on how to resolve? Thanks for your help.
 
 
Post #: 1
 
 Re: VBScript runtime error: overflow - 9/17/2004 11:52:13 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
What is line 1 in your code?

(in reply to sslatimer)
 
 
Post #: 2
 
 Re: VBScript runtime error: overflow - 9/20/2004 6:41:10 AM   
  sslatimer

 

Posts: 4
Score: 0
Joined: 9/17/2004
From: USA
Status: offline
The application uses a combination of forms and VBScript. The entire .vbs file is below. Sorry for dumping so much code. I can post the XML if that helps. Thanks.

Option Explicit

'Global variable (I hope)
Dim theID

Private Sub JumpToPage
Dim objThePage
Dim objTheComboBox

Dim FixDate
Dim FixTime
Dim FixID
'Dim objTheLayer
Dim objRS, objLayer

Set objThePage = Application.Map.Layers("Community_Focal_Points").Forms.Item("EditForm")
Set objTheComboBox = objThePage.Pages("Page1").Controls("cboTable")

'create the unique id to be used in shapefile and DBFs
FixID = (objTheComboBox.ListIndex + 1)
FixDate = Replace(DATE,"/","")
FixTime = FormatDateTime(Time,vbShortTime)
FixTime = Replace(FixTime,":","")
theID = FixID & FixDate & FixTime
msgbox theID

'trying to write theID value into the FACILITYID field of the shapefile
'Trying to access a field that is not bound to any controls on the form

'Get a reference to the layer
Set objLayer = Application.Map.Layers("Community_Focal_Points")
'Get a reference to the layer's recordset
Set objRS = objLayer.Records

'write theID into FACILITYID
objRS.Fields("FACILITYID").Value = theID
'objRS.MoveLast
'objRS.MoveNext
objRS.Update
msgbox objRS.Fields("FACILITYID").Value & " Fac ID"

'if no choice made, notify
If objTheComboBox.ListIndex = -1 Then
msgbox "Please Choose Entity!"
End If
'determine Page to jump to based on entity chosen
If objTheComboBox.ListIndex = 0 Then
objThePage.Pages("PAGE2").Activate
End If
If objTheComboBox.ListIndex = 1 Then
objThePage.Pages("PAGE3").Activate
End If
If objTheComboBox.ListIndex = 2 Then
objThePage.Pages("PAGE4").Activate
End If
If objTheComboBox.ListIndex = 3 Then
objThePage.Pages("PAGE5").Activate
End If
If objTheComboBox.ListIndex = 4 Then
objThePage.Pages("PAGE6").Activate
End If
If objTheComboBox.ListIndex = 5 Then
objThePage.Pages("PAGE7").Activate
End If
If objTheComboBox.ListIndex = 6 Then
objThePage.Pages("PAGE10").Activate
End If
If objTheComboBox.ListIndex = 7 Then
objThePage.Pages("PAGE8").Activate
End If
If objTheComboBox.ListIndex = 8 Then
objThePage.Pages("PAGE10").Activate
End If
If objTheComboBox.ListIndex = 9 Then
objThePage.Pages("PAGE10").Activate
End If
If objTheComboBox.ListIndex = 10 Then
objThePage.Pages("PAGE9").Activate
End If
If objTheComboBox.ListIndex = 11 Then
objThePage.Pages("PAGE10").Activate
End If
If objTheComboBox.ListIndex = 12 Then
objThePage.Pages("PAGE10").Activate
End If
If objTheComboBox.ListIndex = 13 Then
objThePage.Pages("PAGE10").Activate
End If

End Sub

Private Sub WriteToSchoolDBF

Dim objThePage
Set objThePage = Application.Map.Layers("Community_Focal_Points").Forms.Item("EditForm")
Dim myRS
Set myRS = Application.CreateAppObject("recordset")

myRS.Open ("C:\Latimer\Community_pts\levels.dbf"),2 'mode of 2 allows for read/write capability
'myRS.Open ("etdm\levels.dbf"),2 'mode of 2 allows for read/write capability; iPAQ file access
If Not myRS.recordcount=0 Then
myRS.MoveLast 'moves to last record
End If

'the code to check if the check box has been clicked or not
If objThePage.Pages("Page2").Controls("chkType1").Value = True Then
myRS.AddNew 'adds a new record

'myRS.Fields("SCHOOL_ID").Value = Replace(DATE,"/","")& replace(FormatDateTime(Time,vbShortTime),":","")

myRS.Fields("SCHOOL_ID").Value = theID

myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType1").Text

myRS.Update 'saves information to the recordset

End If

If objThePage.Pages("Page2").Controls("chkType2").Value = True Then
myRS.AddNew 'adds a new record

myRS.Fields("SCHOOL_ID").Value = theID

myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType2").Text

myRS.Update 'saves information to the recordset

End If

If objThePage.Pages("Page2").Controls("chkType3").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("SCHOOL_ID").Value = theID

myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType3").Text

myRS.Update 'saves information to the recordset

End If

If objThePage.Pages("Page2").Controls("chkType4").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("SCHOOL_ID").Value = theID

myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType4").Text

myRS.Update 'saves information to the recordset

End If

If objThePage.Pages("Page2").Controls("chkType5").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("SCHOOL_ID").Value = theID

myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType5").Text

myRS.Update 'saves information to the recordset

End If

If objThePage.Pages("Page2").Controls("chkType6").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("SCHOOL_ID").Value = theID

myRS.Fields("TYPE").Value = objThePage.Pages("Page2").Controls("chkType6").Text

myRS.Update 'saves information to the recordset

End If
myRS.Close

'msgbox "Please tap OK to continue"
End Sub



Private Sub WriteToModeDBF

Dim objThePage
Set objThePage = Application.Map.Layers("Community_Focal_Points").Forms.Item("EditForm")
Dim myRS
Set myRS = Application.CreateAppObject("recordset")
'msgbox "recordset created"
myRS.Open ("C:\Latimer\Community_pts\modes2.dbf"),2 'mode of 2 allows for read/write capability
'myRS.Open ("etdm\modes2.dbf"),2 'mode of 2 allows for read/write capability ; iPAQ version
If Not myRS.recordcount=0 Then
myRS.MoveLast 'moves to last record
End If

'the code to check if the check box has been clicked or not
If objThePage.Pages("Page6").Controls("chkMode1").Value = True Then

myRS.AddNew 'adds a new record
'myRS.Fields("ID").Value = Replace(DATE,"/","")& replace(FormatDateTime(Time,vbShortTime),":","")
myRS.Fields("ID").Value = theID

myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode1").Text

myRS.Update 'saves information to the recordset

End If

If objThePage.Pages("Page6").Controls("chkMode2").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("ID").Value = theID

myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode2").Text

myRS.Update 'saves information to the recordset

End If

If objThePage.Pages("Page6").Controls("chkMode3").Value = True Then
myRS.AddNew 'adds a new record

myRS.Fields("ID").Value = theID

myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode3").Text

myRS.Update 'saves information to the recordset

End If

If objThePage.Pages("Page6").Controls("chkMode4").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("ID").Value = theID

myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode4").Text

myRS.Update 'saves information to the recordset

End If
If objThePage.Pages("Page6").Controls("chkMode5").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("ID").Value = theID

myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode5").Text

myRS.Update 'saves information to the recordset

End If
If objThePage.Pages("Page6").Controls("chkMode6").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("ID").Value = theID

myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode6").Text

myRS.Update 'saves information to the recordset

End If
If objThePage.Pages("Page6").Controls("chkMode7").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("ID").Value = theID

myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode7").Text

myRS.Update 'saves information to the recordset

End If
If objThePage.Pages("Page6").Controls("chkMode8").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("ID").Value = theID

myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode8").Text

myRS.Update 'saves information to the recordset

End If
If objThePage.Pages("Page6").Controls("chkMode9").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("ID").Value = theID

myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode9").Text

myRS.Update 'saves information to the recordset

End If
If objThePage.Pages("Page6").Controls("chkMode10").Value = True Then

myRS.AddNew 'adds a new record

myRS.Fields("ID").Value = theID

myRS.Fields("MODE").Value = objThePage.Pages("Page6").Controls("chkMode10").Text

myRS.Update 'saves information to the recordset

End If

myRS.Close

End Sub

(in reply to sslatimer)
 
 
Post #: 3
 
 Re: VBScript runtime error: overflow - 9/21/2004 12:45:22 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Not really sure what the problem is, but I did a quick google search on 800A0006 and found a couple articles that might help you.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&q=800A0006&meta=group%3Dmicrosoft.public.scripting.*

Also, how are you calling the subs? in your script I see nothing to call them.

Mike

(in reply to sslatimer)
 
 
Post #: 4
 
 Re: VBScript runtime error: overflow - 9/21/2004 1:56:05 AM   
  sslatimer

 

Posts: 4
Score: 0
Joined: 9/17/2004
From: USA
Status: offline
The subs are called from an event in a form (i.e., when a button on the form is clicked the sub is called) in the ArcPad application. The forms were developed using ArcPad Studio so they should be fairly "bullet-proof". I thought the problem might be the "theID" item I am writing into the FACILITYID or SCHOOLID (integer/text problem) but I redefined FACILITYID to text and it still happens. Do the values in the DBF tables I am writing to have to be initialized? Thanks!

(in reply to sslatimer)
 
 
Post #: 5
 
 Re: VBScript runtime error: overflow - 9/23/2004 3:22:34 AM   
  sslatimer

 

Posts: 4
Score: 0
Joined: 9/17/2004
From: USA
Status: offline
The overflow was caused by default values for a couple of checkboxes on the form.
The default values were "College/University" and "Technical/Trade" which VBScript
apparently interpreted as division which resulted in the overflow error.

(in reply to sslatimer)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBScript runtime error: overflow Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts