Are you trying to reference a field in MOMAST called "CALD'"? 




IWilson@xxxxxxxxxxxxxxxxxx 
Sent by: mapics-l-bounces@xxxxxxxxxxxx
02/18/2004 08:20 AM

Please respond to
MAPICS ERP System Discussion <mapics-l@xxxxxxxxxxxx>


To
mapics-l@xxxxxxxxxxxx
cc

Subject
Problems With Mapics/Lotus Notes/ADO







Hi All

Hope someone can help me here as I am losing the plot fast.
I am attempting to import data from an AS400 table (The application is
Mapics)
into forms in a Lotus Notes application
Below is the code that I use to connect to the AS400. However when I
attempt to display any value from the record set I get a type mismatch
error. If I change the connection to point to a table in a non-mapics
library I am able to display the value with no problem.
The user profile I am logging on with has the required authority.
I have retrieved data using ADO and Delphi before so this should work.
Has anyone any ideas please.
Thanks in advance for any help.

' ============================================
' The code used
' ============================================
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim OpDoc As NotesDocument
Dim mConn As Variant
Dim mRS As Variant
Dim OperationsView As NotesView
Dim LString As String

Set db = session.CurrentDatabase
Set mConn = createobject("ADODB.Connection")
With mConn
.Provider = "IBMDA400.DataSource.1"
.Properties("Data Source") = "IP ADDRESS"
.Properties("User Id") = "USERNAME"
.Properties("Password") = "PASSWORD"
.Properties("Transport Product") = "Client Access"
.Properties("SSL") = "DEFAULT"
.Properties("Force Translate") = "65535"
.Properties("Convert Date Time To Char") = "TRUE"
.Properties("Catalog Library List") = "AMFLIBA"
.Open
End With

Set mRS = createobject("ADODB.Recordset")
Set mRS.ActiveConnection = mConn
LString = "select * From AMFLIBA.MOMAST"
mRS.Open LString

Set OperationsView = db.GetView("DTrackingByLineItem")
If (Not OperationsView Is Nothing) Then
Do While Not mRS.eof
                  ' I Get A Type Mismatch here
Messagebox  Cstr(mRS.fields("CALD").Value)
mRS.movenext
Loop
End If

mRS.close
Set mRS =Nothing

mConn.close
Set mConn = Nothing


Best Regards

Iain

Here is my disclaimer

_______________________________________________
This is the MAPICS ERP System Discussion (MAPICS-L) mailing list
To post a message email: MAPICS-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mapics-l
or email: MAPICS-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mapics-l.


ForwardSourceID:NT000190A2 

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].