Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SPSS Batch
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Miscellaneous
Thread ID:
00594039
Message ID:
00594400
Views:
55
I connect to the SPSS database once and remain connected.

For each row of data, I check the value of 400 questions in Numeric values of 1-26. Each number correspondes to a letter from a Proficiency Exam. I need to convert each of these answers into a correct/incorrect value of 0 or 1.

Therefore, I do the following:
Public Function MakeMods() As Boolean

On Error GoTo errHandler

Dim MyProgress As clsProgress

Set MyProgress = New clsProgress

frmProc.Hide

Call MyProgress.ShowProgress("Updating SPSS Records", intCount)

DoEvents

With deSPSS.rsqryPE
     
     Do While Not .EOF
     
          If modRecodes.BeginRecode = True Then
               .UpdateBatch adAffectCurrent       '  Set Data
               MyProgress.UpdateProgress          '  Update Progress Bar
          Else
               .CancelBatch
               GoTo errHandler
          End If
          
          .MoveNext
          
     Loop
     
End With

MyProgress.HideProgress

Set MyProgress = Nothing
MakeMods = True

Exit Function

errHandler:
     Set MyProgress = Nothing
     MakeMods = False
     
End Function
The BeginRecode Procedure then calls a procedure for each of the 400 columns. Here is an example of what I do in each.
Public Sub PE0101()

'  Error Control
     On Error GoTo errHandler

'  Select Proper Recode
     Select Case deSPSS.rsqryPE!PE0101
     
     Case 1 - 7
          deSPSS.rsqryPE!PE0101 = 0
          
     Case 8
          deSPSS.rsqryPE!PE0101 = 1
          
     Case 9 - 26
          deSPSS.rsqryPE!PE0101 = 0
          
     End Select
     
Exit Sub
     
errHandler:
     bolRecode = False
     
End Sub
I only open or requery once on begining the process. This application is a one time deal. it will need to be repeated only once in a month or two than it goes away. This is the temporary fix until I re-program an existing system.
__________________________________
Stephen W. Boyd
NJATC I.T. Support
steveb@njatc.org

"Our perceptions are our personal realities" ...unknown
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform