Ask a Question related to ASP Database, Design and Development.
-
John Shaw #1
ADO/Function Confusion
Hi, I'm baffled and frustrated.
I'm working on an export process from my web server to our mainframe.
I can't get the function below to work within the export process.
When I strip it out and runit by itself(see below), it works. In the
file where I need it to work, it doesn't. I'm sure the values are
being passed. The function seems to choke on the rstMain.Open line.
It won't do a response.write after that.
I assume something in the rest of my code is interfering. Can you
suggest things that might cause this problem? Thanks
John
<%
Dim intRecordCount
Dim strAS400File
Dim strOrder_ID
strOrder_ID = "00078275"
strAS400File = "TEST"
intRecordCount = Check_Header_RecordCount("",strOrder_ID)
Response.write("Header intRecordCount: " & intRecordCount & "<br>")
%>
<%
Function Check_Header_RecordCount(strShipTo, strAS400_ID)
Dim rstMain
set rstMain = CreateObject("ADODB.Recordset")
rstMain.CursorLocation = 3
rstMain.Open "SELECT * FROM " & strAS400File & ".IHWEBHUP WHERE
CF05AB='" & strShipTo & "' AND ORD#AB='" & strAS400_ID &"'", _
"DATABASE=IBMDA400.DataSource.1;UID=TESTUSER;PWD=T EST;DSN=TESTDSN"
Check_Header_RecordCount = rstMain.RecordCount
rstMain.close
End Function
%>
John Shaw Guest
-
RRD confusion
I've been using a script called weathergraph on a FreeBSD box for years. Last week I upgraded the machine, and the script stopped working. One of... -
emf confusion
Can anyone tell me what has happened in the settings of Freehand 8 when this problem occurs: Whereas FH drawings that were made months ago, and... -
ai. vs pdf confusion
My illustrator 10 is not cooperating. After making a file going to file>save>format adobe illus and leaving all options clicked, i hit "ok". the file... -
Net Confusion
It should work, but this problem is notorious to VS.NET. See... -
eps confusion
FH has the ability to edit some EPS file, but not all. In fact eps files FH exports are not editable unless you check "Include Freehand". If you have... -
McKirahan #2
Re: ADO/Function Confusion
"John Shaw" <jmshaw@weir.net> wrote in message
news:91422298.0310200727.3b11b003@posting.google.c om...This is just a variation of your code -- does it work?> Hi, I'm baffled and frustrated.
>
> I'm working on an export process from my web server to our mainframe.
> I can't get the function below to work within the export process.
> When I strip it out and runit by itself(see below), it works. In the
> file where I need it to work, it doesn't. I'm sure the values are
> being passed. The function seems to choke on the rstMain.Open line.
> It won't do a response.write after that.
>
> I assume something in the rest of my code is interfering. Can you
> suggest things that might cause this problem? Thanks
>
> John
>
>
> <%
> Dim intRecordCount
> Dim strAS400File
> Dim strOrder_ID
>
> strOrder_ID = "00078275"
> strAS400File = "TEST"
> intRecordCount = Check_Header_RecordCount("",strOrder_ID)
> Response.write("Header intRecordCount: " & intRecordCount & "<br>")
> %>
>
> <%
> Function Check_Header_RecordCount(strShipTo, strAS400_ID)
>
> Dim rstMain
> set rstMain = CreateObject("ADODB.Recordset")
> rstMain.CursorLocation = 3
> rstMain.Open "SELECT * FROM " & strAS400File & ".IHWEBHUP WHERE
> CF05AB='" & strShipTo & "' AND ORD#AB='" & strAS400_ID &"'", _
> "DATABASE=IBMDA400.DataSource.1;UID=TESTUSER;PWD=T EST;DSN=TESTDSN"
>
> Check_Header_RecordCount = rstMain.RecordCount
>
> rstMain.close
>
> End Function
> %>
<% Option Explicit
Dim strAS400File
strAS400File = "TEST"
Dim strOrder_ID
strOrder_ID = "00078275"
Dim intRecordCount
intRecordCount = Check_Header_RecordCount("",strOrder_ID)
Response.Write("<br> Header intRecordCount: " & intRecordCount)
Function Check_Header_RecordCount(strShipTo, strAS400_ID)
Const adOpenStatic = 3
Dim strDSN
strDSN =
"DATABASE=IBMDA400.DataSource.1;UID=TESTUSER;PWD=T EST;DSN=TESTDSN"
Dim intRST
intRST = -1
Dim strSQL
strSQL = "SELECT * FROM " & strAS400File & ".IHWEBHUP
strSQL = strSQL & " WHERE CF05AB = '" & strShipTo & "'"
strSQL = strSQL & " AND ORD#AB = '" & strAS400_ID & "'"
Response.Write("<br> strSQL = " & strSQL)
Dim objRST
Set objRST = CreateObject("ADODB.Recordset")
objRST.Open strSQL, strDSN, adOpenStatic
intRST = objRST.RecordCount
objRST.Close
Set objRST = Nothing
Response.Write("<br> intRST = " & intRST)
Check_Header_RecordCount = intRST
End Function
%>
McKirahan Guest
-
John Shaw #3
Re: ADO/Function Confusion
"McKirahan" <News@McKirahan.com> wrote in message news:<koUkb.597276$Oz4.592267@rwcrnsc54>...
Nope, this is what I get.> "John Shaw" <jmshaw@weir.net> wrote in message
> news:91422298.0310200727.3b11b003@posting.google.c om...>> > Hi, I'm baffled and frustrated.
> >
> > I'm working on an export process from my web server to our mainframe.
> > I can't get the function below to work within the export process.
> > When I strip it out and runit by itself(see below), it works. In the
> > file where I need it to work, it doesn't. I'm sure the values are
> > being passed. The function seems to choke on the rstMain.Open line.
> > It won't do a response.write after that.
> >
> > I assume something in the rest of my code is interfering. Can you
> > suggest things that might cause this problem? Thanks
> >
> > John
> >
> >
> > <%
> > Dim intRecordCount
> > Dim strAS400File
> > Dim strOrder_ID
> >
> > strOrder_ID = "00078275"
> > strAS400File = "TEST"
> > intRecordCount = Check_Header_RecordCount("",strOrder_ID)
> > Response.write("Header intRecordCount: " & intRecordCount & "<br>")
> > %>
> >
> > <%
> > Function Check_Header_RecordCount(strShipTo, strAS400_ID)
> >
> > Dim rstMain
> > set rstMain = CreateObject("ADODB.Recordset")
> > rstMain.CursorLocation = 3
> > rstMain.Open "SELECT * FROM " & strAS400File & ".IHWEBHUP WHERE
> > CF05AB='" & strShipTo & "' AND ORD#AB='" & strAS400_ID &"'", _
> > "DATABASE=IBMDA400.DataSource.1;UID=TESTUSER;PWD=T EST;DSN=TESTDSN"
> >
> > Check_Header_RecordCount = rstMain.RecordCount
> >
> > rstMain.close
> >
> > End Function
> > %>
> This is just a variation of your code -- does it work?
>
> <% Option Explicit
> Dim strAS400File
> strAS400File = "TEST"
> Dim strOrder_ID
> strOrder_ID = "00078275"
> Dim intRecordCount
> intRecordCount = Check_Header_RecordCount("",strOrder_ID)
> Response.Write("<br> Header intRecordCount: " & intRecordCount)
>
> Function Check_Header_RecordCount(strShipTo, strAS400_ID)
> Const adOpenStatic = 3
> Dim strDSN
> strDSN =
> "DATABASE=IBMDA400.DataSource.1;UID=TESTUSER;PWD=T EST;DSN=TESTDSN"
> Dim intRST
> intRST = -1
> Dim strSQL
> strSQL = "SELECT * FROM " & strAS400File & ".IHWEBHUP
> strSQL = strSQL & " WHERE CF05AB = '" & strShipTo & "'"
> strSQL = strSQL & " AND ORD#AB = '" & strAS400_ID & "'"
> Response.Write("<br> strSQL = " & strSQL)
> Dim objRST
> Set objRST = CreateObject("ADODB.Recordset")
> objRST.Open strSQL, strDSN, adOpenStatic
> intRST = objRST.RecordCount
> objRST.Close
> Set objRST = Nothing
> Response.Write("<br> intRST = " & intRST)
> Check_Header_RecordCount = intRST
> End Function
> %>
strSQL = SELECT * FROM TEST.IHWEBHUP WHERE CF05AB = '' AND ORD#AB = '00078275'
intRST = -1
Header intRecordCount: -1
John Shaw Guest
-
McKirahan #4
Re: ADO/Function Confusion
"John Shaw" <jmshaw@weir.net> wrote in message
news:91422298.0310201914.2f84c93d@posting.google.c om...news:<koUkb.597276$Oz4.592267@rwcrnsc54>...> "McKirahan" <News@McKirahan.com> wrote in message'00078275'>> > "John Shaw" <jmshaw@weir.net> wrote in message
> > news:91422298.0310200727.3b11b003@posting.google.c om...> >> > > Hi, I'm baffled and frustrated.
> > >
> > > I'm working on an export process from my web server to our mainframe.
> > > I can't get the function below to work within the export process.
> > > When I strip it out and runit by itself(see below), it works. In the
> > > file where I need it to work, it doesn't. I'm sure the values are
> > > being passed. The function seems to choke on the rstMain.Open line.
> > > It won't do a response.write after that.
> > >
> > > I assume something in the rest of my code is interfering. Can you
> > > suggest things that might cause this problem? Thanks
> > >
> > > John
> > >
> > >
> > > <%
> > > Dim intRecordCount
> > > Dim strAS400File
> > > Dim strOrder_ID
> > >
> > > strOrder_ID = "00078275"
> > > strAS400File = "TEST"
> > > intRecordCount = Check_Header_RecordCount("",strOrder_ID)
> > > Response.write("Header intRecordCount: " & intRecordCount & "<br>")
> > > %>
> > >
> > > <%
> > > Function Check_Header_RecordCount(strShipTo, strAS400_ID)
> > >
> > > Dim rstMain
> > > set rstMain = CreateObject("ADODB.Recordset")
> > > rstMain.CursorLocation = 3
> > > rstMain.Open "SELECT * FROM " & strAS400File & ".IHWEBHUP WHERE
> > > CF05AB='" & strShipTo & "' AND ORD#AB='" & strAS400_ID &"'", _
> > > "DATABASE=IBMDA400.DataSource.1;UID=TESTUSER;PWD=T EST;DSN=TESTDSN"
> > >
> > > Check_Header_RecordCount = rstMain.RecordCount
> > >
> > > rstMain.close
> > >
> > > End Function
> > > %>
> > This is just a variation of your code -- does it work?
> >
> > <% Option Explicit
> > Dim strAS400File
> > strAS400File = "TEST"
> > Dim strOrder_ID
> > strOrder_ID = "00078275"
> > Dim intRecordCount
> > intRecordCount = Check_Header_RecordCount("",strOrder_ID)
> > Response.Write("<br> Header intRecordCount: " & intRecordCount)
> >
> > Function Check_Header_RecordCount(strShipTo, strAS400_ID)
> > Const adOpenStatic = 3
> > Dim strDSN
> > strDSN =
> > "DATABASE=IBMDA400.DataSource.1;UID=TESTUSER;PWD=T EST;DSN=TESTDSN"
> > Dim intRST
> > intRST = -1
> > Dim strSQL
> > strSQL = "SELECT * FROM " & strAS400File & ".IHWEBHUP
> > strSQL = strSQL & " WHERE CF05AB = '" & strShipTo & "'"
> > strSQL = strSQL & " AND ORD#AB = '" & strAS400_ID & "'"
> > Response.Write("<br> strSQL = " & strSQL)
> > Dim objRST
> > Set objRST = CreateObject("ADODB.Recordset")
> > objRST.Open strSQL, strDSN, adOpenStatic
> > intRST = objRST.RecordCount
> > objRST.Close
> > Set objRST = Nothing
> > Response.Write("<br> intRST = " & intRST)
> > Check_Header_RecordCount = intRST
> > End Function
> > %>
> Nope, this is what I get.
>
> strSQL = SELECT * FROM TEST.IHWEBHUP WHERE CF05AB = '' AND ORD#AB =Try enclosing ORD#AB in brackets; it may not like "#" : [ORD#AB]> intRST = -1
> Header intRecordCount: -1
Also, is ORD#AB numeric; if fo then remove the apostrophes:
SELECT * FROM TEST.IHWEBHUP WHERE CF05AB = '' AND ORD#AB = 00078275
McKirahan Guest



Reply With Quote

