Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OLE connection to a AS400 Database in vbscript

308 views
Skip to first unread message

Christophe Chene

unread,
Jun 30, 2000, 3:00:00 AM6/30/00
to
I wrote a vbscript in an ASP page in order to print on the browser the
content of an AS400 file.

The problem is that when i make my request, the browser show all records
even if i insert a WHERE condition in order to filter records.

the code is :

<%
Dim objConnect
Dim objRecordset

Set objConnect = Server.CreateObject("ADODB.Connection")
objConnect.open "provider=IBMDA400;data source=MyAS400Name", request("User")
, request("Pwd")
Set objRecordset = Server.CreateObject("ADODB.Recordset")
objRecordset.CursorType= adOpenStatic
objRecordset.open "SELECT * FROM LIB/FILE(MEMBER) Where USER='toto' " ,
objConnect
%>

If someone knows why....

Mark Spencer

unread,
Jul 1, 2000, 3:00:00 AM7/1/00
to
Not necessarily the answer, but have you tried substituting HAVING for WHERE
? I had similar problems with an MS-SQL database & this helped. There are
weird differences between batabase vendor's "versions" or implementations of
SQL-92.
Could also be the VB-Script syntax... quite possibly the " Where USER='toto'
" is validated to "true, returning all records. Could maybe try " WHERE
TABLE!User = 'toto' " or some variation to that effect. I find VB-Script is
sometimes a little ambiuous about data types.
Hope this might help ...

Mark Spencer

Christophe Chene <christop...@norbert-dentressangle.com> wrote in
message news:8jhkds$6io$1...@lyon110.dtr.fr...

Christophe Chene

unread,
Jul 3, 2000, 3:00:00 AM7/3/00
to
Thank you for your answer, but it don't work.
I've tried using "HAVING" or using Table.Field but neither the having nor
the table.field return a filtered table.


Christophe Chene

unread,
Jul 3, 2000, 3:00:00 AM7/3/00
to
I forgot one thing, the ASP pages are on a Win 98 computer with PWS .

Mark Spencer

unread,
Jul 3, 2000, 3:00:00 AM7/3/00
to
I have never gotten Windows 98's PWS to work properly. I have only ever
gotten this stuff to work on NT4.0/IIS4.0. Sorry if i mis-directed you...
But the SQL stuff should work..... I will try some experimentation myself &
if I find anything I will re-post. @8-)

Mark Spencer

Christophe Chene <christop...@norbert-dentressangle.com> wrote in

message news:8jq1qh$u8h$1...@lyon110.dtr.fr...

Christophe Chene

unread,
Jul 5, 2000, 3:00:00 AM7/5/00
to
I ' ve found the Pb ==> the synthaxe of the select !!!

with a "select * from bib/file where ..." the where is ommitted in the
result (bug??)

with a "select * from bib.file where ..." it works perfectly !!!


0 new messages