1

Hey I am working on a password changer. User logs in ( successfully), loads a global var with user initials, then launch a password expired form. I try and use those initials on the password expired form to retrieve user info from DB.

vaUserLog.FieldValue("USERINIT") = UserInitials
vaUserLog.GetEqual
vaStat = vaUserLog.Status

vaStat keeps giving me an error of 4. I am using pervasive v9. Connection with VA looks like:

With vaUserLog
        .RefreshLocations = True
        .DdfPath = DataPath
        .TableName = "USERLOG"
        .Location = "USERLOG.MKD"
        .Open
        If .Status <> 0 Then
           ErrMsg = "Error Opening File " + .TableName + " - Status " + str$(.Status) + vbCrLf + "Contact IT Department"
        End If
    End With

In DB table, USERINIT is Char, 3. UserInitials is a String.

Probably missing something small but can't think right now. Any help is appreciate. Lemme know if you require more info.

Cheers

Jose
  • 13
  • 2

1 Answers1

1

Status 4 means that the record could not be found. In your case, it could be the case of the value being searched is wrong, there's a different padding (spaces versus binary zero), or that the UserInitials value just isn't in the data file. You can use MKDE Tracing to see what's actually being passed to the PSQL engine. Once you've done that, make sure the value you're using works through the Function Executor where you can open the file and perform a GetEqual.
Here are my suggestions: - Make sure you're pointing to the right data files. - Make sure you're passing the right value into the GetEqual (by setting the FieldValue).

mirtheil
  • 8,952
  • 1
  • 30
  • 29
  • Hmm alright, so I made sure I was pointing to the right data. Had PCC open and ensured that data was in there. I also tried switching to the USERID, which actually worked. Only diff between the 2 fields in the DB are the length of Char lol I'm baffled. – Jose Jun 30 '11 at 18:28
  • I just noticed something else that might be causing this. I don't see where you're setting the index to be used for the GetEqual. If you haven't changed it to the USERINT field, then a status 4 would probably occur. – mirtheil Jun 30 '11 at 20:01