Query returns no records (does in excel)

I have setup a Word 2013 macro to fill a combobox from an iseries (HTE-sun) data-source, the query works from excel and fills the spreadsheet - macro works fine. I am attempting to setup to pull the data live directly from the AS400 -- query runs without error but returns no records (.recordcount=-1^) --- The basic code I used is: Set rsPI110AP = New ADODB.Recordset Set cnPI110AP = New ADODB.Connection Dim sqlPI110AP As String Dim strTemp As String Dim i As Long cnPI110AP.ConnectionString = "DSN=AS400; Uid=**;Pwd=****" cnPI110AP.Open sqlPI110AP = "SELECT PI110AP.PIIN, PI110AP.PIID1, PI110AP.PIID2, PI110AP.PIUOMO FROM S1072EEF.HTEDTA.PI110AP PI110AP ORDER BY PI110AP.PIIN"

rsPI110AP.Open sqlPI110AP, cnPI110AP, adOpenStatic, adLockReadOnly

I've been apart from AS400 a few years so I may be missing something -- What do I need to do to correct this construct? Any help would be most appreciated. Thank you

0
edit delete
are you sure?
asked Wendell Clark

0 answers

Post an answer but please login first

Post Answer
  1. Please login to post answer

Similar Questions

Tagsfor this question

Forumall questions