|
-
Feb 19th, 2004, 09:14 AM
#1
Thread Starter
Hyperactive Member
RESOLVED!! Missing fields from AS400 query
I am testing how long to make an info lookup for account numbers, item#s, etc. to our AS400. Below is a part of my code:
VB Code:
Label3.Text = TimeString 'START TIME
Dim dataCON2 As New OdbcConnection("Provider=MSDASQL;DSN=JDE;SYSTEM=XXXX;
UID=XXXX;Password=XXXX;DBQ=XXXX")
dataCON2.Open()
Dim dataCMD2 As New OdbcCommand("SELECT IMITM, IMLITM, MAITM, IMDSC1,
IMDSC2 FROM F4101 WHERE IMLITM = '" & Textbox2.Text & "'", dataCON2)
Dim dataREADER2 As OdbcDataReader = dataCMD2.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
Label4.Text = TimeString 'END TIME
DataGrid2.DataSource = dataREADER2
DataGrid2.DataBind()
When I run the query with a valid item# entered into TEXTBOX2 , I get the correct record back but I always lose the fields IMLITM and IMAITM. What I can't figure is the sample query is based on a condition where IMLITM = TEXTBOX2 and yet, this field is left out when displayed on the datatgrid.
When I debug the datareader to show me what's the value of my field, I get this for IMLITM and IMAITM:
_____________
?datareader2.GetValue(1)
{System.Array}
(0): 247
(1): 240.... until .... (24): 64
_____________
It's coming out as an array when it has a character type definition in AS400. Anyone has an idea why this is so?
Thanks
Last edited by ARPRINCE; Feb 19th, 2004 at 10:50 AM.
-
Feb 19th, 2004, 10:16 AM
#2
Thread Starter
Hyperactive Member
I investigated a little further this problem. Using VB6 and ADODC1 control, I run the same query binded into a datagrid. It returns me all the fields compared to the VB.NET datagrid. However, the data is displayed as special characters (For example, field IMLITM and IMAITM is shown as "|||||||||@").
When checking for the field type, it is giving me "128 or Binary Data" when it is defined as alphanumeric in AS400.
VB Code:
?adodc1.Recordset.Fields(0).Type 'IMITM as adNumeric
131
?adodc1.Recordset.Fields(1).Type 'IMLITM as adBinary*
128
?adodc1.Recordset.Fields(2).Type 'IMLITM as adBinary*
128
?adodc1.Recordset.Fields(3).Type 'IMDSC1 as asChar
129
?adodc1.Recordset.Fields(4).Type 'IMDCS2 as adChar
129
Anyone have ideas? This is driving me nuts!
-
Feb 19th, 2004, 10:50 AM
#3
Thread Starter
Hyperactive Member
OK. I finally got this one fixed. On my ODBC setup for my IBM client access and under the translation tab, I placed a check on Convert Binary Data (CCSID 65535) to text and that did it!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|