Ask a Question related to ASP Database, Design and Development.
-
Croney69 #1
Am I doing anything wrong?
Could you advise if I am doing anything wrong?
Page: bdConnect.asp
<%
Set DataConn = Server.CreateObject("ADODB.Connection")
'DataConn.ConnectionTimeout = 15
'DataConn.CommandTimeout = 30
'DataConn.mode = 16
DataConn.provider="MSDASQL.1"
DataConn.Open "Driver={Microsoft Visual FoxPro Driver};" &
_
"SourceType=DBC;" & _
"SourceDB=c:\inetpub\wwwroot\mydatabase\mydatabase .
dbc;" & _
"Exclusive=No; Null=No"
%>
Page: MyPage.asp
<!--#include file="bdConnect.asp" --> 'Top of the page
This script is in the body in a table
<TD>
<%
set rs = server.CreateObject("ADODB.RecordSet")
' GET USER ID
vUserID = Replace(Request.ServerVariables
("logon_USER"),"UNITED\","")
vUserID = ucase(vUserID)
' GET USER ID NUMBER FROM USER
TABLE
rs.Source="SELECT id From User Where upper
(cLogInID)='"& vUserID &"'"
rs.Open, DataConn
vUserID=rs("id")
rs.Close
' GET THE LAST RECORD ID NUMBER
rs.source="SELECT max(id) as MaxID From
filerequests"
rs.Open, DataConn
maxid=rs("maxid")
rs.Close
' GET INFORMATIO FOR THE USER OUT OF THE
FILEREQUEST TABLE AND ADD EACH TO FILEREQUEST
rs.Source="SELECT FileRequestBulk.id,
FileRequestBulk.cPolicy, PolicyData.cName,
PolicyData.cOldPolicy FROM FileRequestBulk LEFT JOIN
PolicyData on FileRequestBulk.cPolicy=PolicyData.cPolicy
Where iUser="& vUserID
rs.open, DataConn
C=0
' CREATE ARRAY
do until rs.EOF
c=c+1
Client=Client &""& rs("cPolicy")&""& rs("cName")
&""& rs("cOldPolicy")
rs.MoveNext
Loop
rs.Close
'DO LOOP TO ADD REQUEST TO FILEREQUEST
TABLE (ONLY POLICIES THAT HAVE NOT BEEN ALREADY REQUESTED)
I=0
CancelReq=0
do until I=C or I>25
I=I+1
maxid=maxid+1 ' Next record number
' Break down array
P=left(Client,12) ' Policy number
N=mid(Client,13,16) ' Name of client
OP=mid(Client,29, 12) ' Old Policy number
Client=mid(Client,41) ' Remove this policy data
from the array
' CHECK TO SEE IF THE POLICY IS
ALERADY OUT AND ADD POLICY IF NOT
rs.source="SELECT asc(dtoc(tReturnDat)) as RTD,
id, cUserID, tRequestDa, tTimeStamp, cClient, cPolClmNo,
CPolOld, iPriority From FileRequests Where cpolclmno ='"&
P &"' and asc(dtoc(tFileDate))=32"
rs.Open, DataConn,2,3
if rs.EOF then
'ADD REQUEST TO FILEREQUEST
rs.AddNew
rs("id")=maxid
rs("cUserID")=vUserID
rs("tRequestDa")=now()
rs("tTimeStamp")=now()
rs("cClient")=N
rs("cPolClmNo")=P
rs("cPolOld")=OP
rs("iPriority")="0"
rs.Update
rs.Close
'INSERT INTO
FILEREQUESTCHECKER FOR FILING ROOM
rs.Source="INSERT INTO
FileRequestChecker (cPolicy, dRequested, id) VALUES ('"& P
&"', {"& date() &"}, "& maxid &")"
rs.Open, DataConn
'DELETE DATA OUT
OF FILEREQUESTBULK
Set rs = nothing
set rs = server.CreateObject
("ADODB.RecordSet")
rs.Source="DELETE from
FileRequestBulk Where cPolicy='"& P &"' and iUser="&
vUserID
rs.Open,dataConn
else
RTD=rs("RTD")
ID=rs("id")
rs.Close
' File was already
in use
rs.Source="UPDATE FileRequestBulk
Set iReason= "& RTD &" Where id="& id
rs.Open,dataConn
CancelReq=CancelReq+1
end if
Loop
Set rs = nothing
DataConn.Close
set DataConn=nothing
if CancelReq >0 then
response.write "Some of the policies that you have
requested have been canceled and remain in your bulk
folder as they are already in use. You can try requesting
the policies again by the usual method to see if they have
been requested by another user and have been placed in the
filing tray.<p>Total files:"& CancelReq
Response.write "<P><Div Align='Center'><a
href='viewBulk.asp'><IMG src='../Images/View.png'
border=0></a></Div>"
else
Response.redirect "../view.asp"
end if%>
</TD>
Croney69 Guest
-
something wrong..
I want to integrate following php-file into my Flash-movie, but something still does not work. The Php-file is like that: Online it looks like... -
What am I doing wrong?
> rs.Source="SELECT id From User Where upper I asked this before... Try sql = "SELECT id FROM user WHERE UPPER(cLoginID) = '" & vUserID &... -
What is wrong?
Take a look at your Stored Procedure. It takes a wide variety of data types. But in your code, you use an overloaded version of the Add() method of... -
What am I doing wrong???!?!
I have a simple form that based on the the two inputs, ExAD_Tracking and ExAD_DateEntered, will query the database and display the records... -
What am I doing wrong
I am trying to fade in an image over time, however the image keeps blinking, it fades in all the time. Below is my script. on exitFrame me go to... -
Aaron Bertrand [MVP] #2
Re: Am I doing anything wrong?
> rs.Source="SELECT id From User Where upper
How about> (cLogInID)='"& vUserID &"'"
> rs.Open, DataConn
set rs = DataConn.execute("SELECT ... ")
Why?> ' GET THE LAST RECORD ID NUMBER
You don't know this for sure, if id is an autonumber. Someone else could> maxid=maxid+1 ' Next record number
run an insert while this script is running. Instead of trying to predict
the next value, get it when you insert.
[url]http://www.aspfaq.com/2174[/url]
Aaron Bertrand [MVP] Guest
-
Croney69 #3
Re: Am I doing anything wrong?
Someone else could>-----Original Message----->>> rs.Source="SELECT id From User Where upper
>> (cLogInID)='"& vUserID &"'"
>> rs.Open, DataConn
>How about
>
>set rs = DataConn.execute("SELECT ... ")
>>>> ' GET THE LAST RECORD ID NUMBER
>Why?
>>>> maxid=maxid+1 ' Next record number
>You don't know this for sure, if id is an autonumber.trying to predict>run an insert while this script is running. Instead ofI am using DBF to store my data which dose not have>the next value, get it when you insert.
>
>[url]http://www.aspfaq.com/2174[/url]
>
>
>.
>
autounmber.
Thanks of the help
Croney69 Guest
-
Croney69 #4
Re: Am I doing anything wrong?
I have requested help on my problem and will post it below.>-----Original Message-----
>Croney69 wrote:
>>>> Could you advise if I am doing anything wrong?
>>
>> Page: bdConnect.asp
>> ...
>how about telling us what your problem is instead of
>dumping all your code here.
>
>
>--
>rgndrp
>.
>
I am using Windows2000 server, IIS5 and ASP to produce and
Intranet for the employees with applications to help with
their day-to-day work. I have recently redesign to site
and move away from the global.asa and have also switch
from mdb to dbf to link back into our front office
program.
I am now encountering a problem where users are unable to
view any pages that access the database. (ASP pages) This
dose not affects html or ASP pages that do not connect to
the database.
This problem occurs after one day. Restarting the IIS will
resolve the problem for a time then the only way it to
restart the server.
I have notice that by removing this page it seems to stop
the problem. But I need to know what the problem is so
that this error would not occur again.
I was advise to use IISState but I could not see any thing
wrong and ask for help. Got none! I was also told to use
AdPlus, same problem with the reports. No help.
Can you haelp?
Croney69 Guest
-
Aaron Bertrand - MVP #5
Re: Am I doing anything wrong?
> I am using DBF to store my data which dose not have autounmber.
Maybe you should choose a database that supports the features you need?
Aaron Bertrand - MVP Guest
-
Croney69 #6
Re: Am I doing anything wrong?
autounmber.>-----Original Message----->> I am using DBF to store my data which dose not havefeatures you need?>
>Maybe you should choose a database that supports theThe site will be interfacing with a front office system>
>
>.
>
design in Visual Fox. I was using Access mdb before. :(
Croney69 Guest



Reply With Quote

