|
|
Search
|
|||||||
| Home | Register | Downloads | FAQ | Members List | Calendar | Arcade | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Registered User
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
__________________
|
|
|
|
| Advertisement | [Remove Advertisement] | ||
|
|
|
|
#2 (permalink) |
|
Knowledge is the solution
![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
__________________
|
|
|
|
|
|
#3 (permalink) |
|
AKA snkmad
![]() ![]() ![]() ![]() ![]() ![]() 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 |
|
|
|
|
|
#5 (permalink) |
|
Behind ur girlfriend :D
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#6 (permalink) |
|
Knowledge is the solution
![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. :/
__________________
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|