Saturday, 13 December 2008
|
| strange result of Date value comparsion C676228 23:15:49 |
| | Hi all,
I hope I am not out of my mind.
I have the following code: The iMonthlenght here is 1, EffectiveDate is 12/16/2008, expiration date is 1/12/2009. I displayed in the web already.
'***************************** Response.Write "Effective Date Value again: " & DateAdd("m", iMonthLength, EffectiveDate) & "<br>" Response.Write "Expiration Date again before comparision: " & ExpirationDate & "<br>" '******************** 'after checking, the debugging message still shows that EffectiveDate is 12/16/2008, expiration date is 1/12/2009, while DateAdd("m", iMonthLength, EffectiveDate) is 1/16/2009. but somehow DateAdd("m", iMonthLength, EffectiveDate) <= ExpirationDate evaluates to be true. I don't get it. How come 1/16/2009 is earlier than 1/12/2009.
if DateAdd("m", iMonthLength, EffectiveDate) <= ExpirationDate then 'my program gets to here for the data I gave above???? Response.Write "strange value again?: " & "<br>" Response.Write DateAdd("m", iMonthLength, EffectiveDate) Response.Write "<br>" Response.Write ExpirationDate & "<br>" ' it tells me in black and while that my effectiveDate and expiration don't change at all, that's what I expected but how come this statement -DateAdd("m", iMonthLength, EffectiveDate) <= ExpirationDate would be true?
end if
-- Betty
|
| | 6 answers | Add comment |
Friday, 12 December 2008
|
| Questionnaire script with multiple input types Ll 23:19:57 |
| | Hi, I'm working on a questionnaire which will include multiple input types (check boxes, drop-downs, textarea) to submit answers. Currently, in my design, I have 3 tables: Answer, Question, and Stream. The same 5 questions are asked as they relate to the 8 streams of course discipline - in other words, the 5 questions are asked 8 times each. I had thought of using loops to accomplish this, although at present the stumper is getting a graceful and effiicient means of dealing with the different data types. The first thing that came to mind was using a different table for each different data type in the Answers. Would there be something perhaps more simple and efficient?
Many thanks for any help, Louis
|
| | 3 answer | Add comment |
|
| Create an SQL string from selected form items Guest 17:36:25 |
| | Hi,
I have an asp form with several search fields available. Each search field has a check box against it, i.e. the user can decide which fields should be included in the search. Some fields are text boxes, others are drop downs.
I want to know how to create a simple SQL search string based on the fields the user selects (or rather based on the check boxes the users selects and the data in those fields to search on.
I have the following in my ASP code
customer = request.form("CustomerName") ...user can select from a list date_s = request.form("start") .... user enters a date mm/dd/yyyy date_e = request.form("end") .... user enters a date mm/dd/yyyy product = request.form("prod") .... user enters a code or part of a code serial = request.form("serial") .... user enters a number or part of a number fr = request.form("Fault-R") .... user enters a string to find matching ff = request.form("Fault-F") .... user selects from a drop down fn = request.form("Fault-N").... user enters a string to find matching ca = request.form("Cause-F").... user selects from a drop down cn = request.form("Cause-N").... user enters a string to find matching
Obviously the user could select any combination of fields, so what is the best way of handling this ?
Appreciate your help / advice
Thanks
David
|
| | 3 answer | Add comment |
Thursday, 11 December 2008
|
| Can I use Request to Accept query String Hon123456 07:22:13 |
| | Dear all,
I got a link as follows:
<a href="outdolistdata.asp?user=<%=user%>&outboundno=< %=stroutboundno%>&inboundno=<%=strinboundno%>&house=<%=strhouse %>&house1=<%=strhouse1%>&refno=<%=strrefno%>&invoiceno=<%=strinvoiceno %>&HAWB=<%=strHAWB%>&pono=<%=strpono%>&HAWBno=<%=strHAWBno%>&NAV=< %=intPageCount%>">Last Page</a>
Can I just use request("user"), request("outboundno"), request ("inboundno") to accept the query string in the Link. As I found in the web page, only request.querystring can be used to accept the querystring in the link. My question is can I just use request("something") to accept outdolistdata?something="abc" but not using request.querystring.
Thanks.
|
| | 2 answer | Add comment |
Wednesday, 10 December 2008
|
| Response Buffer Limit Exceeded Ron Hinds 03:37:58 |
| | I'm getting this in an ASP application on IIS6/W2K3. The page in question is trying to return a XML file approximately 45MB in size. Changing this is not an option. Worked fine on IIS5/W2K. I tried Response.Buffer = False, no joy. So I searched on MSDN and found instructions for increasing the AspBufferingLimit property in the metabase. I increased it to 100MB for that web application, stopped and restarted that web application, still same result.
I ran into a similar problem on the same web app in two pages where we are trying to receive a file of approx. 10MB in size. I was told to set the AspMaxRequestEntityAllowed property in the metabase for the specific pages. I set it to 16MB for each - they still don't work, either. How can I make my legacy app work in IIS6?
|
| | 3 answer | Add comment |
Tuesday, 9 December 2008
|
| Formatting Generated SQL Statements Joe 23:34:58 |
| | I am building a small helper application to create a table, stored procedures and triggers. I need to output the SQL formatted instead of all together. For instance, here is an Update Trigger that I have generated,
CREATE TRIGGER updTrips ON dbo.Trips AFTER UPDATE AS IF @@ROWCOUNT = 0 RETURN INSERT INTO [dbo].[Audit_Changes] ([PrimaryID], [ColumnChanged], [TableChanged], [OldValue], [NewValue], [Username], [DTChanged], [ActionType]) SELECT i.TripID, CASE col# WHEN 2 THEN 'TripDate' WHEN 3 THEN 'StartTime' WHEN 4 THEN 'EndTime' ELSE '?' END, 'Trips', CASE col# WHEN 2 THEN CAST(d.TripDate AS VARCHAR(25)) WHEN 3 THEN d.StartTime WHEN 4 THEN d.EndTime ELSE '?' END, CASE col# WHEN 2 THEN CAST(i.TripDate AS VARCHAR(25)) WHEN 3 THEN i.StartTime WHEN 4 THEN i.EndTime ELSE '?' END, SUSER_SNAME(), GETDATE(), 'U' FROM inserted i INNER JOIN deleted d ON i.TripID = d.TripID CROSS JOIN ( SELECT 2 AS col# UNION ALL SELECT 3 AS col# UNION ALL SELECT 4 AS col# ) AS col#s WHERE ISNULL(CASE col# WHEN 2 THEN CAST(i.TripDate AS VARCHAR(25)) WHEN 3 THEN i.StartTime WHEN 4 THEN i.EndTime ELSE '?' END, '') <> ISNULL(CASE col# WHEN 2 THEN CAST(d.TripDate AS VARCHAR (25)) WHEN 3 THEN d.StartTime WHEN 4 THEN d.EndTime ELSE '?' END, '')
Which is very, very messy... I would like to figure out how to format the SQL so it looks something like this,
CREATE TRIGGER updTrips ON dbo.Trips AFTER UPDATE AS IF @@ROWCOUNT = 0 RETURN INSERT INTO [dbo].[Audit_Changes] ([PrimaryID], [ColumnChanged], [TableChanged], [OldValue], [NewValue], [Username], [DTChanged], [ActionType]) SELECT i.TripID, CASE col# WHEN 2 THEN 'TripDate' WHEN 3 THEN 'StartTime' WHEN 4 THEN 'EndTime' WHEN 5 THEN 'Duration' WHEN 6 THEN 'RLU' WHEN 7 THEN 'TripPlace' WHEN 8 THEN 'TripPurpose' ELSE '?' END, 'Trips', CASE col# WHEN 2 THEN CAST(d.TripDate AS VARCHAR(25)) WHEN 3 THEN d.StartTime WHEN 4 THEN d.EndTime WHEN 5 THEN d.Duration WHEN 6 THEN d.RLU WHEN 7 THEN d.TripPlace WHEN 8 THEN d.TripPurpose ELSE '?' END, CASE col# WHEN 2 THEN CAST(i.TripDate AS VARCHAR(25)) WHEN 3 THEN i.StartTime WHEN 4 THEN i.EndTime WHEN 5 THEN i.Duration WHEN 6 THEN i.RLU WHEN 7 THEN i.TripPlace WHEN 8 THEN i.TripPurpose ELSE '?' END, SUSER_SNAME(), GETDATE(), 'U' FROM inserted i INNER JOIN deleted d ON i.TripID = d.TripID CROSS JOIN ( SELECT 2 AS col# UNION ALL SELECT 3 AS col# UNION ALL SELECT 4 AS col# UNION ALL SELECT 5 AS col# UNION ALL SELECT 6 AS col# UNION ALL SELECT 7 AS col# UNION ALL SELECT 8 AS col# ) AS col#s WHERE ISNULL(CASE col# WHEN 2 THEN CAST(i.TripDate AS VARCHAR(25)) WHEN 3 THEN i.StartTime WHEN 4 THEN i.EndTime WHEN 5 THEN i.Duration WHEN 6 THEN i.RLU WHEN 7 THEN i.TripPlace WHEN 8 THEN i.TripPurpose ELSE '?' END, '') <> ISNULL( CASE col# WHEN 2 THEN CAST(d.TripDate AS VARCHAR(25)) WHEN 3 THEN d.StartTime WHEN 4 THEN d.EndTime WHEN 5 THEN d.Duration WHEN 6 THEN d.RLU WHEN 7 THEN d.TripPlace WHEN 8 THEN d.TripPurpose ELSE '?' END, '')
I have tried vbCrLf, vbNewLine, etc... and nothing seems to work. Any ideas?
Thanks, Drew
|
| | 5 answers | Add comment |
|
| Endicia Label Server Question Mangler 16:05:47 |
| | Anyone here use Endicia Label Server to generate USPS shipping lables using ASP VBScript? If so can someone provide a small snippet of sample code on how this works? Endicia provides sample code but not in this language and I am trying to figure this out.
If not can someone point me to where something like this is?
|
| | Add comment |
|
| MasterType Directive Error Rfcarter 02:35:30 |
| | I am trying to set a strongly typed referece to my Master Page from content pages and get the following error when I build:
Error 1 The type name 'ISOTimeSheets' does not exist in the type 'ISOTimeSheets.ISOTimeSheets'
The code inserted into the designer.cs for the web page is the following:
/// <summary> /// Master property. /// </summary> /// <remarks> /// Auto-generated property. /// </remarks> public new ISOTimeSheets.ISOTimeSheets Master { get { return ((ISOTimeSheets.ISOTimeSheets)(base.Master)); }
The line I added to my content page is:
<%@ MasterType VirtualPath="~/ISOTimeSheets.Master" %>
The project is not strongly named due to a vendor component that I am using, but just to see of this was the issue I strongly named the project and the error still exists. There is not much help on the web other than showing how to use the directive. If I cannot get this to work with the directive does someone have a code snippet that would allow me to loosely couple? I saw one vague reference to loose coupling but no examples in my reseatch thus far.
What I am trying to accomplish is the establishment of some properties on the master page so I can reduce, and hopefully eliminate, the need to session vaiables in my application.
Thanks
|
| | 2 answer | Add comment |
Monday, 8 December 2008
|
| can i update the record in one page only.i am using asp Guest 16:43:31 |
| | can i update the record in one page only.i am using asp
|
| | 1 answer | Add comment |
Sunday, 7 December 2008
|
| Publish to Provider Chasgl 01:09:00 |
| | Visual Studio 2008, I have a local database in the file system. I want to publish it so I start the Publish to Provider Wizard. I choose my database and click next, I get : TITLE: Microsoft SQL Server ------------------------------
This wizard will close because it encountered the following error:
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server+Database+Publishing+Wizard&ProdVer=1.2.0.0&EvtSrc=Microsoft.SqlServer.Management.UI.WizardFrameworkErrorSR&EvtID=UncaughtException&LinkId=20476
------------------------------ ADDITIONAL INFORMATION:
Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. (Microsoft.SqlServer.ConnectionInfo) If I follow the link it says "no more information". It looks like is a dll. Any thoughts? I found one reference but it said to publish tab of the project properties. I have found the Property Pages but there is no publish section. Thanks, Chas
|
| | 2 answer | Add comment |
Saturday, 6 December 2008
|
| New install of VB6 doesn't recognize IIS AlBruAn 19:57:59 |
| | There is a possibility I'll begin working on a new contract within the next few weeks involving maintenance and enhancements to existing VB6/ASP applications. For the last six years, I've been using VB.Net and C# exclusively, so I want to try removing the rust from my VB6 skills. Anyway...
My laptop has Vista Ultimate installed on it. I can't get the development environment for VB6 to install on it, so I set up a virtual machine using Virtual PC 2007. I installed Windows XP Pro and the IIS component on the virtual machine and was able to install VB6 without any problem. I can create any kind of application BUT an IIS application. When I attempt to do so, I get an error message back stating, "Internet Information Server or Peer Web Services 3.0 or later must be installed to run WebClasses."
What am I missing? What should I be looking for? What must I do to get this working correctly? Thanks in advance for any and all help.
-- Things are more like they are now than they ever have been before.
|
| | 1 answer | Add comment |
Friday, 5 December 2008
|
| ASP Looping, Recursion to display hierarchy (How to?) Matt 20:35:32 |
| | I am having some serious brain-melting session just trying to wrap my head around what I'm trying to accomplish, but unfortunately I've never been able to properly put it into words. I found some articles on using recursion to display a hierarchy on the file system. Unfortunately, I think I GET the basic concept of what recursion means now (I think, but I'm likely wrong), but I cannot figure out how to migrate the practice into how my database works.
I have two tables. One table has "Locations" (tb_locations), and another table has "Machines" (tb_machines). Being this as the case, I have a SQL JOIN query to allow me to pull all the information from both tables.
My SQL Query is as follows: [code]"SELECT * FROM tb_locations p LEFT JOIN tb_machines c ON p.f_locationID = c.f_machineparent ORDER BY p.f_locationname, c.f_machinename"[/code]
As you can see, tb_machines.f_machineparent references tb_locations.f_locationID. I have looked through literally thousands of pages of Google results and have found hundreds of examples of recursion, but none dealing with my scenario of two related database tables.
Here is my current code, which does get the first "Location" and the first "Machine" related to that location, but it simply loops through that machine hundreds of times until I get "Out of Memory" errors: [code] Call ListCategory(0) Sub ListCategory(parentID) ' -- Create Recordset -- Dim rs_clients Dim rs_clients_cmd Dim rs_clients_numRows Set rs_clients_cmd = Server.CreateObject ("ADODB.Command") rs_clients_cmd.ActiveConnection = MM_conn_beaconreader_STRING rs_clients_cmd.CommandText = "SELECT * FROM tb_locations p LEFT JOIN tb_machines c ON p.f_locationID = c.f_machineparent ORDER BY p.f_locationname, c.f_machinename" rs_clients_cmd.Prepared = true Set rs_clients = rs_clients_cmd.Execute rs_clients_numRows = 0 ' -- Loop Through Pages -- If Not rs_clients.EOF Then Do While Not rs_clients.EOF response.write Space(10) & "<div id=""sitemap-category"">" & vbCrLf response.write Space(12) & "<ul>" & vbCrLf response.write Space(14) & "<li class=""parent"">" & rs_clients("f_locationname") & "</a></li>" & vbCrLf Call ListSubCategory(rs_clients("f_locationID"), 1) response.write Space(14) & "<div id=""clear""></div>" & vbCrLf response.write Space(12) & "</ul>" & vbCrLf response.write Space(10) & "</div>" & vbCrLf intCounter = intCounter + 1 If intCounter Mod 3 = 0 Then response.write Space(10) & "<div id=""clear""></div>" & vbCrLf End If rs_clients.MoveNext Loop End If ' -- Clear Divs -- If intCounter Mod 3 <> 0 Then response.write Space(10) & "<div id=""clear""></div>" End If ' -- Close Connection -- rs_clients.Close Set rs_clients = Nothing End Sub Sub ListSubCategory(f_locationID, Counter) Dim rs_machines Dim rs_machines_cmd Dim rs_machines_numRows Set rs_machines_cmd = Server.CreateObject ("ADODB.Command") rs_machines_cmd.ActiveConnection = MM_conn_beaconreader_STRING rs_machines_cmd.CommandText = "SELECT * FROM tb_locations p LEFT JOIN tb_machines c ON p.f_locationID = c.f_machineparent ORDER BY p.f_locationname, c.f_machinename" rs_machines_cmd.Prepared = true Set rs_machines = rs_machines_cmd.Execute rs_machines_numRows = 0 ' -- Loop Through Pages -- If Not rs_machines.EOF Then Do While Not rs_machines.EOF response.write Space(14) & "<li style=""margin-left: " & (Counter * 10) & "px;"">" & rs_machines("f_machinename") & "</li>" & vbCrLf Counter = Counter + 1 Call ListSubCategory(rs_machines("f_locationID"), Counter) Counter = Counter - 1 rs_machines.MoveNext Loop End If ' -- Close Connection -- rs_machines.Close Set rs_machines = Nothing End Sub [/code] Result: [code] - Paris - machine01 -machine01 -machine01 -machine01 -machine01 ...etc [/code]
So at some point I'm missing a step on getting out of that first machine's loop and moving onto the second machine. Does anybody have any experience with this?
Thanks in advance, Matt
|
| | 7 answers | Add comment |
|
| Which is better... Filtering on PK in FKey table or FKey in parent table Mike Wazowski 00:08:20 |
| | Hello
Hopefully a simple one for you SQL Gurus out there.
I have tblCustomers and tblCountries. Each customer can only belong to one Country.
Which is likely to give better performance?
SELECT Fields FROM tblCustomers INNER JOIN tblCountries ON tblCustomers.CountryID = tblCountries.CountryID WHERE tblCustomers.CountryID IN(1, 2, 3)
OR
SELECT Fields FROM tblCustomers INNER JOIN tblCountries ON tblCustomers.CountryID = tblCountries.CountryID WHERE tblCountries.CountryID IN(1, 2, 3)
In other words, is it more performant to filter on the CountryID primary key in tblCountries or on the indexed (not clustered) Country ID in tblCustomers?
I am joining tblCountries because I return tblCountries.CountryName to the end user.
Many thanks
Mike
|
| | 15 answers | Add comment |
Thursday, 4 December 2008
|
| How to share code between website and its subfolders? Sm 18:29:12 |
| | This is regarding ASP.NET 2.0. I need the same code to be executable at the root of a website and in subfolders of the website. I know of two possibilities: [1] put the code in a DLL and put the DLL in the 'Bin' subfolders of the root and the subfolders. [2] put the source code directly in the 'App_Code' folders of the root and the subfolders.
Is there any way to have code just in one folder and invokable from any other subfolder of a website, so that code is shared?
A related question: when I compile a DLL project in a website solution in VStudio 2005, what is the equivalent of adding a reference to a DLL (project or file) in VStudio in the hosting website? Putting it another way, if I manually deploy a website at a production host, how do I specify the location of a DLL in client code? I put a DLL in the 'Bin' folder, and placed other client code in the 'App_Code' folder. How do I specify to the code in the 'App_Code' folder the location of the DLL?
Thanks in advance for answers.
|
| | 1 answer | Add comment |
|
| CRLF characters in HTML page ? Dorian 18:25:15 |
| | MS I'm formatting an email in HTML format with data from my MS Access DB. All is fine except the text from text fields which contains carriage return-line feeds is unformatted. Does anyone know if there is some way to make the HTLM recognize the CRLF characters and format the text column data correctly? Thanks.
|
| | 2 answer | Add comment |
Wednesday, 3 December 2008
|
| Weird problem with a form Mangler 01:05:23 |
| | I have a form on a page that has to hidden fields that simply hold a value. There is a link in that form that when pressed calls a javascript function to open a new window. All ok so far. The page that opens depends on those 2 hidden fields mentioned before, this is where the issue is happening. On my local testing server everything works great yet on the production server the values of the fields do not get passed to the new page like on the testing server.
Testing server : Vista Home Premium, IIS 7 Production Server : Windows server 2003 IIS ( the version that comes standard on this os )
Here is the form :
<form action="" method="post" name="form2" id="form2" > <img src="images/print1.png" alt="Printer Friendly" width="53" height="53" onclick="MM_openBrWindow ('submissionReportPrintFriendly.asp?start=<%=Request("start1") %>&end=<%=Request("end1")%>','','scrollbars=yes,resizable=yes')" / <input type="hidden" name="start1" id="start1" /> <input type="hidden" name="end1" id="end1" /> </form>
I cannot figure out why this works perfectly on the testing server but not the production server. Any Ideas?
|
| | 1 answer | Add comment |
Tuesday, 2 December 2008
|
| Error on page, but when you navigate back and resubmit, no Error Joe 23:14:33 |
| | I am trying to track down an error I am having on one of my interfaces. The form takes the data, formats it and runs it through a SP on SQL Server 2000, the SP outputs a number depending on whether or not the insert was made and returns to the application to show the user a message.
Here is my code,
If Request.Form("action") = "insert" Then
set conn = CreateObject("ADODB.Connection") conn.open MM_EmpCore_STRING
'Submit data to SP if submit is clicked dim varPosID,varRoleTitle,varRoleCode,varSWVTCTitle,varDepartment,varBuilding,varOtherBuilding,varShift,varWorkersCompCode,varPayBand,varFLSA,varStatus,varSupervisorPosID,varHIPAALevel,varGrade,varStep,varEEOCode,varSupervisor
varPosID = CStr(Request.Form("PosID")) varRoleTitle = CStr(Request.Form("RoleTitle")) varRoleCode = CStr(Request.Form("RoleCode")) varSWVTCTitle = CStr(Request.Form("SWVTCTitle")) varDepartment = CInt(Request.Form("DeptID")) varBuilding = CInt(Request.Form("BuildingID")) varOtherBuilding = CInt(Request.Form("OtherBuildingID")) varShift = CStr(Request.Form("Shift")) varWorkersCompCode = CInt(Request.Form("WorkersCompCode")) varPayBand = CInt(Request.Form("PayBand")) varFLSA = CStr(Request.Form("FLSA")) varStatus = CStr(Request.Form("Status")) varEEOCode = CStr(Request.Form("EEOCode")) varSupervisorPosID = CStr(Request.Form("SupervisorID")) varHIPAALevel = CInt(Request.Form("HIPAALevel")) varGrade = Request.Form("Grade") If varGrade <> "" Then varGrade = CInt(varGrade) Else varGrade = 0 End If varStep = Request.Form("Step") If varStep <> "" Then varStep = CInt(varGrade) Else varStep = 0 End If varSupervisor = CBool(Request.Form("Supervisor"))
set rs = createobject("adodb.recordset")
'Response.Write("InsertPosition " & varPosID & "," & varDepartment & "," & varBuilding & "," & varOtherBuilding & "," & varSupervisorPosID & "," & varRoleTitle & "," & varRoleCode & "," & varEEOCode & "," & varSWVTCTitle & "," & varShift & "," & varWorkersCompCode & "," & varHIPAALevel & "," & varGrade & "," & varStep & "," & varPayBand & "," & varFLSA & "," & varStatus & "," & varSupervisor) conn.InsertPosition varPosID,varDepartment,varBuilding,varOtherBuilding,varSupervisorPosID,varRoleTitle,varRoleCode,varEEOCode,varSWVTCTitle,varShift,varWorkersCompCode,varHIPAALevel,varGrade,varStep,varPayBand,varFLSA,varStatus,varSupervisor, rs
If IsEmpty(rs) = False Then dim varOutput varOutput = rs(0) End If
'Close Connection conn.close: set conn = nothing
dim varMsg,varNotInserted varNotInserted = 0
Select Case varOutput Case 2 'Employee inserted successfully, so redirect Response.Redirect("http://swvtc06/swvtc/DB/Emp/EmpCore_New/ default.asp?action=AddPosition") Case 0 varMsg = "The position was not added because there is already a position with that position number. You can either change the position number and try to add it again, or you can go <a href=""http://swvtc06/swvtc/DB/Emp/EmpCore_New/changePosition.asp? PosID=" & varPosID & """>change the existing position</a>." varNotInserted = 1 Case Else Response.Write("<" & "script>alert('*Error Inserting Position* Contact Drew Laing at extension 311');") Response.Write("<" & "/script>") End Select End If
On the line that specifies the output number, varOutput = rs(0), I get the following error, "Item cannot be found in the collection corresponding to the requested name or ordinal", but if I click Back and then click Submit again, the application works fine (either returns a message that the Position ID is already used, or redirects).
What the heck am I doing wrong?
Thanks, Drew
|
| | 2 answer | Add comment |
|
| Question about using REST resources in classic ASP Anthony Papillion 20:56:44 |
| | Hello Everyone,
I've just taken on a project to develop a piece of software in classic ASP. While I have the rest of the development process firmly under control, I'm not sure how to use REST resources in classic ASP. I've done a Google search and can't find anything that addresses it. Can anyone point me to a good resource or give me a clue?
Thanks! Anthony
|
| | 5 answers | Add comment |
Friday, 28 November 2008
|
| Parameterized query query MikeR 14:51:03 |
| | I'm working on my first site using parameterized queries. I can't find how to handle the fields for an INSERT, UPDATE or DELETE when the values have an apostrophe, comma, or quote in them. i.e:
str2qry = "qry_Update_Sta " & request.form("LastName") & ", " & _ request.form("Height") & ", " & request.form("Group")
Set StaRS = server.createobject("adodb.recordset") Set Aconn = server.createobject("adodb.connection") Aconn.Open "provider=Microsoft.Jet.OLEDB.4.0;" & "data source=" & DBPath
StaRS.Open str2qry, AConn,0,4
where request.form("LastName") = O'Doules request.form("Height") = 5'10" request.form("Group") = Peter, Paul, and Mary
TIA Mike
|
| | 10 answers | Add comment |
Tuesday, 25 November 2008
|
| Can I make Asp program sleep? C676228 13:16:41 |
| | Hi all,
We use Payflow Pro from Verisign(Now it calls paypal Payflow Pro) as a gateway software to process credit card payment.
Most of time, Paypal server is OK and we don't have problems for credit card payment. But we do experience some issues sometimes. i.e. Occasionally, after credit card information was submitted to payPal server, we didn't get any response from their server, no error code, it is just an empty string.
I am not sure how it happened. I am thinking it's probably caused by our server program not waiting long enough for their server's response if their server has some performance issue(slow in response) at that time. When the server response is not back yet, our program goes forward already, then cause the return string from their server is empty. Am I on the right track?
That's why I am thinking to make our asp program sleep for a while at this statement:
Executor.Application = sDosCmd 'this command basically has credit card info for processing sResult=Executor.ExecuteDosApp 'sResult is the string back from paypal server
I want to add sleep 3000 right after this statement. then check is sResult is empty, if not, program goes on. If yes, continue to sleep... until a non-empty string returns or quit the transaction after a long enough waiting.
Would you like to share some your experiences of credit card transactions? I am dealing with a production server, so it is a very critical issue for us.
I googled a bit. It says on ServerObejcts.com it has waitfor 1.0 we can download. I don't see this product.
Thank you, -- Betty
|
| | 6 answers | Add comment |
|
| List Field Names, Data Types and Descriptions !Tg 03:53:55 |
| | Should be simple, but I'm having trouble finding the code. I want to loop through the fields in a table and display a form based on the DataType and Description of each field in the table. I found the code a long time ago, but I can't seem to locate it again. Any help?
|
| | 1 answer | Add comment |
Monday, 24 November 2008
|
| ASP (not .net) 1.1 Aspquerrier 14:13:46 |
| | Hi, I have a question on ASP (not .NET) I need (due to a strange ASP page design I am modifying) to pass a value from the querystring (which is received from the URL calling the form) to a HTML Submit input box so that it will be passed on to the form itself in a secondary iteration (the form is used as submitting to itself with many other values in user typed input fields which are passed succesfully). If I try to pass the querystring to a variable, and read the variable, it is empty after the user clicks 'submit'. So the question is, how does one programmatically populate a HTML text field with a value from the quesrystring (URL)? or, how does one programmatically pass a querystring value to the form itself if it submits to itself? Thanks
|
| | 6 answers | Add comment |
Saturday, 22 November 2008
|
| One works the other doesn't MikeR 04:50:31 |
| | I've got two pages in the same folder on my site quering an Access DB. The code below works <% Option Explicit dim DBPath, conn, StaRS, SanCall, Update
if request.servervariables("Server_Name") = "broomhilda" then DBPath = Server.MapPath("..\fpDB\my.mdb") else DBPath = Server.MapPath("\fpdb\my.mdb") end if
Update = false If Request.Form("Call") <> "" then SanCall = Replace(request.form("Call"), "'", "''") Update = true ElseIf Request.QueryString("Call") <> "" then SanCall = Replace(request.Querystring("Call"), "'", "''") Update = true End If SanCall = Replace(SanCall, ";", "") SanCall = UCase(SanCall)
set StaRS = server.createobject("adodb.recordset") if Update then set conn = server.createobject("adodb.connection") conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & DBPath StaRS.Open "byCall " & SanCall , conn End If %>
This fails with error message Error Type: Provider (0x80004005) Unspecified error /nf4l/dir1/asp/Display_Admin.asp, line 19
As far as I can tell, the code is identical. Google hasn't given me anything to solve it yet.
<% Option Explicit dim DBPath, Aconn, HoldRS
If Session("Allowed") <> "00boola00" then Server.transfer("error.asp") End If
Response.Buffer = True session.timeout = 60 if request.servervariables("Server_Name") = "broomhilda" then DBPath = Server.MapPath("..\fpDB\my.mdb") else DBPath = Server.MapPath("\fpdb\my.mdb") end if set HoldRS = server.createobject("adodb.recordset") set AConn = server.createobject("adodb.connection") Aconn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & DBPath <==== Line 19 'HoldRS.Open "qry_hold_list ", Aconn, 0, 4 %>
TIA, Mike
|
| | 13 answers | Add comment |
Thursday, 20 November 2008
|
| Exporting to Excel (xlsx files) Doogie 18:17:20 |
| | Can anoyne tell me why this VBScript will create the file to Excel just fine, but the Excel file will not open up? I am saving it as a xlsx file instead of an xls one and I have the new version of Excel on my machine and have opened other Excel files with that extension but this one I get the following error:
"Excel cannot open the file 'Test.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and the file extension matches the format of the file."
If I switch the file type to be .xls instead of .xlsx, it will save the file and open with no problems. Below is an example of the VB script I'm using.
dim Cn,Rs set Cn=server.createobject("ADODB.connection") set Rs=server.createobject("ADODB.recordset") Cn.open "MyConnectionString" Rs.open "mysqlquery",Cn,1,3 Response.ContentType = "application/vnd.ms-excel" Response.AddHeader "Content-Disposition", "attachment; filename=Test.xlsx" if Rs.eof <> true then response.write "<table border=1>" while not Rs.eof response.write "<tr><td>" & Rs.fields("mydatafield") & "</
</tr>" Rs.movenext wend
response.write "</table>" end if
set rs=nothing Cn.close
|
| | 5 answers | Add comment |
|