Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
Home Register Downloads FAQ Members List Calendar Arcade Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
Old October 18th, 2009   #1 (permalink)
Registered User
 
val_jason999's Avatar
 
Join Date: Mar 2009
Location: unknown
Posts: 28
please tell me what caused Out of Stack space error in my code

this one...

Dim closin As Boolean
Dim amt, newadded As Integer
Dim straugment As String
Private Sub cmdConfirm_Click()
If cmdConfirm.Caption = "&Redo" Then
txtTitle.Enabled = True
txtAuthor.Enabled = True
txtYr.Enabled = True
cboGenre.Enabled = True
cmdConfirm.Caption = "&Confirm"
cmdSave.Enabled = False
Else
txtTitle.Enabled = False
txtAuthor.Enabled = False
txtYr.Enabled = False
cboGenre.Enabled = False
cmdConfirm.Caption = "&Redo"
cmdSave.Enabled = True
End If
End Sub

Private Sub cmdSave_Click()
OpenDB
rs.Open "select * from BookProperty", db, adOpenDynamic, adLockOptimistic
rs.AddNew
rs!AccessionNo = straugment
rs!BookID = txtBookID.Text
rs!Title = txtTitle.Text
rs!Author = txtAuthor.Text
rs!Genre = cboGenre.Text
rs!YearPublished = txtYr.Text
rs!Condition = "Available"
rs.Update
rs.Close
CloseDB
If newadded = amt Then
' Unload Me
' frmBook.Enabled = True
Else
frmBook.txtAdd.Text = Val(frmBook.txtAdd.Text) + 1
newadded = Val(frmBook.txtAdd.Text)
cmdSave.Enabled = False
cmdConfirm.Caption = "&Confirm"
closin = True
Form_Load
End If
End Sub

Private Sub Form_Load()
txtTitle.Enabled = True
txtAuthor.Enabled = True
txtYr.Enabled = True
cboGenre.Enabled = True

amt = Val(frmBook.txtNoToAdd.Text)

If newadded < 2 Then
newadded = Val(frmBook.txtAdd.Text) + 1
straugment = frmBook.cboAccessNo.Text
Else
If amt <= newadded Then
Unload Me
End If
End If
txtAccNo.Text = straugment
txtTitle.Text = frmBook.txtTitle.Text
txtYr.Text = frmBook.txtYrPublished.Text
txtAuthor.Text = frmBook.txtAuthor.Text
cboGenre.Text = frmBook.cboGenre.Text
If amt >= 2 And amt <> newadded Then
GetBookIDbtch
End If
End Sub

Sub GetBookIDbtch()
OpenDB
rs.Open "select count(BookID) as total from BookProperty where AccessionNo like'" & txtAccNo.Text & "'", db, adOpenDynamic, adLockOptimistic
txtBookID.Text = "BK-" & StrConv(Left$(txtTitle.Text, 3), vbUpperCase) & "-" & Hex$(Right$(Format(Time, "HHMM"), 4)) & "-" & Format(rs!total + 1, "0#")
rs.Close
CloseDB
End Sub

Private Sub Form_Unload(Cancel As Integer)
If closin = False Then
If MsgBox("Do you wish to cancel?", vbQuestion + vbYesNo, "Information") = vbYes Then
frmTest.FinishAdd
Cancel = 0
Else
Cancel = 1
End If
Else
frmTest.FinishAdd
Cancel = 0
End If
End Sub
__________________
val_jason999
val_jason999 is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old October 19th, 2009   #2 (permalink)
Knowledge is the solution
 
Proto's Avatar
 
Join Date: Dec 2002
Location: Milwaukee, US. Previously in Mexico City
Posts: 6,559
1. you might want to use the [code][/code] tags just so the code has better readability

2. The debugger is there for a reason. Follow your code execution step per step and find the conflicting line. Personally I think that 'select *' line looks suspicious, if your DB is way too large you might be trying to bite more than you can chew there, which would explain he stack overflow. redesign your db request so that you only read the columns you strictly need.
__________________
Proto is offline   Reply With Quote
Old 4 Weeks Ago   #3 (permalink)
Mad
AKA snkmad
 
Mad's Avatar
 
Join Date: Apr 2001
Location: Brazil, Fortaleza-Ceará
Posts: 3,301
That's C#?
__________________
[Windows 7 RTM PRO X64] [Gigabyte GA-G31M-S2L] [Intel E5200@2.5Ghz] [Corsair XMS2 DHX 4GB DDR2 800MHz] [HIS HD4670 1GB GDDR3] [19" LCD SyncMaster T190] [Samsung SATA II HD322HJ 320GB] [LG HL-DT-ST DVD-RAM GH22NS30]
(@gigaherz) S.N.K.M.A.D.: Synthetic Networked Killing and Masterful Assassination Device
Mad is offline   Reply With Quote
Old 4 Weeks Ago   #4 (permalink)
Knowledge is the solution
 
Proto's Avatar
 
Join Date: Dec 2002
Location: Milwaukee, US. Previously in Mexico City
Posts: 6,559
Looks like Vb.net
__________________
Proto is offline   Reply With Quote
Old 4 Weeks Ago   #5 (permalink)
Behind ur girlfriend :D
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Sydney, Australia
Posts: 18,918
eww, give up on that crap. .net 1.0 doesn't even install on x64 os's so you'll never get the runtime you need.
__________________


VBA-M | Xtemu | NGOHQ | Post Impact Productions | TNHW | XBCD 0.2.6 | Satanic666's Emulator Compiles
Don't be a NOOB, READ THE NGEmu/EmuForums Rules of Conduct
Need Help with ePSXe? This is your first stop!.

If you don't post all the required information, you don't get help.
Everytime someone posts a romsite, God kills a beautiful woman.
Squall-Leonhart is offline   Reply With Quote
Old 4 Weeks Ago   #6 (permalink)
Knowledge is the solution
 
Proto's Avatar
 
Join Date: Dec 2002
Location: Milwaukee, US. Previously in Mexico City
Posts: 6,559
it really depends on what he needs to do, the right tool for the task at hand and stuff. If his only users are 32bits OS then he doesn't really have to worry about other cases. :/
__________________
Proto is offline   Reply With Quote
Old 4 Weeks Ago   #7 (permalink)
Registered User
 
val_jason999's Avatar
 
Join Date: Mar 2009
Location: unknown
Posts: 28
Actually this is vb6... I should be more accurate when posting huh...
__________________
val_jason999
val_jason999 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 00:25.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5