Hi, Noble.
>Does anyone know why this happens and how to fix it?
I think I have a pretty good idea of
what happens, but I'm afraid I don't know
why (yet).
>does anyone know a quicker way to get this information back?
I developed the following script for a friend of mine. It worked for him, so perhaps it will work for you.
Copy the following code and paste it into Notepad. Edit the line to specify the "MAP_" DSN name for your address book database. (If you're unsure, check the ODBC control panel applet or the Pervasive Control Centre.) Save the file with a .VBS extension, then double-click to run it.
Disclaimers: This is not supported by Maximizer. Use at your own risk. Back up your data first. etc.
Option Explicit
' *** edit the following line to point to the correct "MAP_" DSN ***
Const strDSN = "MAP_AddressBook"
Dim oCon, oCmd, oRst, lDmi
Set oCon = CreateObject("ADODB.Connection")
oCon.Open "DSN=" & strDSN & ";"
Set oRst = CreateObject("ADODB.Recordset")
oRst.Open _
"SELECT Data_Machine_Id " & _
"FROM AMGR_UsrFldDefsTbl " & _
"WHERE Type_Id=58851", _
oCon
lDmi = oRst("Data_Machine_Id")
oRst.Close
Set oRst = Nothing
Set oCmd = CreateObject("ADODB.Command")
oCmd.ActiveConnection = oCon
oCmd.CommandText = _
"DELETE FROM AMGR_UsrFldDefsTbl " & _
"WHERE Type_Id=58850"
oCmd.Execute
Set oCmd = Nothing
Set oCmd = CreateObject("ADODB.Command")
oCmd.ActiveConnection = oCon
oCmd.CommandText = _
"INSERT INTO AMGR_UsrFldDefsTbl (" & _
"Data_Machine_Id, " & _
"Sequence_Number, " & _
"Table_Id, " & _
"Type_Id, " & _
"Code_Id, " & _
"MaxMerge_Lock, " & _
"Style_Id, " & _
"Hotlist, " & _
"Def_Type, " & _
"Client_Type, " & _
"Priv, " & _
"Owner_Id, " & _
"Creator_Id, " & _
"Create_Date, " & _
"Create_Time, " & _
"ReadPriv, " & _
"ReadOnly_Id, " & _
"Mandatory, " & _
"Reserved, " & _
"Description " & _
") VALUES (" & _
lDmi & ", " & _
"1, " & _
"1, " & _
"58850, " & _
"0, " & _
"0, " & _
"887, " & _
"2, " & _
"1, " & _
"7, " & _
"0, " & _
"'MASTER', " & _
"'MASTER', " & _
"'" & ToStdDate(Now) & "', " & _
"'" & ToStdTime(Now) & "', " & _
"0, " & _
"'', " & _
"0, " & _
"'', " & _
"'E-mail Address' " & _
")"
oCmd.Execute
Set oCmd = Nothing
oCon.Close
Set oCon = Nothing
WScript.Echo "Done."
Function ToStdDate (dtmVal)
' convert DateTime value to string in standard form yyyy-mm-dd
dim yyyy, mm, dd
yyyy = CStr(Year(dtmVal))
mm = str2dl0(Month(dtmVal))
dd = str2dl0(Day(dtmVal))
ToStdDate = yyyy & "-" & mm & "-" & dd
End Function
Function ToStdTime (dtmVal)
' convert DateTime value to string in hh:nn:ss
dim hh, nn, ss
hh = str2dl0(Hour(dtmVal))
nn = str2dl0(Minute(dtmVal))
ss = str2dl0(Second(dtmVal))
ToStdTime = hh & ":" & nn & ":" & ss
End Function
Function str2dl0 (num)
' return num as string, 2 digits, leading 0
If num > 9 Then
str2dl0 = CStr(num)
Else
str2dl0 = "0" & num
End If
End Function
>I have been plagued with problems [...] and could use some help.
Are you working with a Business Partner? If not, you might want to contact Maximizer for a referral.