If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > AS/400 SQL Error (VB Script)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-12-03, 07:29
mtoru mtoru is offline
Registered User
 
Join Date: Sep 2003
Posts: 6
Question AS/400 SQL Error (VB Script)

Hi ;
I'm trying to connect and get daas from An As/400 flat file.
I've succeeded to connect Database and get datas from a flat of DB File.

But I have a problem with SQL. source code is below :

Dim conn_as400_str, conn_as400, rs_as400, sql, a

Set conn_as400 = CreateObject("ADODB.Connection")
conn_as400_str = "Provider=IBMDA400;Data Source=SYSTEMNAME"
conn_as400.Open conn_as400_str

Set rs_as400 = CreateObject("ADODB.Recordset")
sql = "Select * from LIBRARY/FILE(MEMBER) WHERE FIELDA LIKE '34%'"
rs_as400.Open sql, conn_as400

a = 0

Do While Not rs_as400.EOF
a = a + 1
Cells(1, 1).Value = a
rs_as400.movenext
Loop

rs_as400.Close
conn_as400.Close

* There are ALL DATAS In the recordset. But I just want the datas which starts 34 (As I declared in SQL). Why doesnt work my SQL correctly ?
Must it be different SQL stsatment for AS/400 ?
Did I use WHERE wrong ?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On