ASP

81K

Solutions

31K

Contributors

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

Share tech news, updates, or what's on your mind.

Sign up to Post

I have a query in Classic ASP that has the potential to grow to thousands of rows.



  <%

' Our own constants:
Const PAGE_SIZE = 10  ' The size of our pages.

' Declare our variables... always good practice!
Dim strURL     ' The URL of this page so the form will work
               ' no matter what this file is named.

Dim cnnSearch  ' ADO connection
Dim rstSearch  ' ADO recordset
Dim strDBPath  ' path to our Access database (*.mdb) file

Dim strSQL     ' The SQL Query we build on the fly
Dim strSearch  ' The text being looked for

Dim iPageCurrent ' The page we're currently on
Dim iPageCount   ' Number of pages of records
Dim iRecordCount ' Count of the records returned
Dim I            ' Standard looping variable

' Retreive the URL of this page from Server Variables
strURL = Request.ServerVariables("URL")

' Retreive the term being searched for.  I'm doing it on
' the QS since that allows people to bookmark results.
' You could just as easily have used the form collection.
strSearch = Request("search")

' Retrieve page to show or default to the first
If Request.QueryString("page") = "" Then
	iPageCurrent = 1
Else
	iPageCurrent = CInt(Request.QueryString("page"))
End If


If strSearch = "" Then

  'Display all the details passed

			'	for i=1 to request.form.count
			'	response.write Trim(request.form.key(i))&"; "& Trim(request.form.item(i)) &"<br>"
			'	Next

		'Response.End 
	
	Set cnnSearch = Server.CreateObject("ADODB.Connection")

	' This line is for the 

Open in new window

0
Cloud Class® Course: C++ 11 Fundamentals
LVL 12
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Leaving sensitive information (like passwords) in clear text scripts is never a good practice, though it's sometimes unavoidable. This set of VBScript functions can be used to obscure critical information making it at least a little more difficult for curious eyes (or worse) to see.
0
 
LVL 43

Expert Comment

by:Rob
Comment Utility
Hi Lee,

I really like this script as I've had to use a lot of vbs for automating systems and interacting with databases and reports and this would be really useful.

I did get an error with the Decrypt part when using a 10-10-10 key.  Is there a limitation to the size of the key? what am I missing?  The following did work when I used a smaller key e.g. 7-7-7

Error:
C:\Users\rjurd\OneDrive\Desktop>encrypt.vbs E monsterAiden18 10-10-10
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

674A748B36662E6DB5860512A66C8698F6E0B910238EF143C1E206F731E7AAAC23757697449AB80B982D89F89DBE77B73B22B555A67FAA4B9EE634B30F6A

C:\Users\rjurd\OneDrive\Desktop>encrypt.vbs D 674A748B36662E6DB5860512A66C8698F6E0B910238EF143C1E206F731E7AAAC23757697449AB80B982D89F89DBE77B73B22B555A67FAA4B9EE634B30F6A 10-10-10
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Users\rjurd\OneDrive\Desktop\encrypt.vbs(43, 9) Microsoft VBScript runtime error: Invalid procedure call or argument: 'Chr'

Open in new window

0
 
LVL 97

Author Comment

by:Lee W, MVP
Comment Utility
@Rob, I'm glad you find it useful!  Thanks to your comment I realized I forgot to mention a key point (no pun intended).  The last digit cannot be greater than 9.  I've also detailed how the hashes are made up, hopefully a little more clearly than following the code.  This is by design.

@everyone else, if you have a problem like Rob did, please let me know.  I'd like to perfect this as much as I can perfect it. I'm also open to tips to make it stronger (already have one idea).
1
I am maintaining an old, old classic ASP site - there is a form which includes the following tag around the "submit" image:

<a href="javascript:ValidateMakeForm();" onMouseOver="msover(1); return true" onMouseOut="msout(1)">

The function is defined on the page like below - basically sets the form action and submits the form.

<script language="javascript">
function ValidateMakeForm()
{
	if (document.forms['searchmake'].category_id.selectedIndex == 0)
	{	
		alert("You must select a make.");
		document.forms['searchmake'].category_id.focus();
		return;
	}
	document.forms['searchmake'].action = document.forms['searchmake'].category_id.value;
	document.forms['searchmake'].submit();
}
</script>

Open in new window


IE 11 is throwing an error 'ValidateMakeForm' is undefined.   Everything works in Chrome, Firefox and Edge and even in IE 11 when viewed in Compatibility Mode.
0
Hello all;

OK, I need to count some numbers, and if the number matches, then assign that number to the folder.

This is the Image folders. (yes, the X is in the name of the folders)
000XXXXX
001XXXXX
002XXXXX
003XXXXX
004XXXXX
005XXXXX
006XXXXX
007XXXXX
008XXXXX
009XXXXX
01XXXXXX
02XXXXXX
03XXXXXX
04XXXXXX
05XXXXXX
06XXXXXX
07XXXXXX
08XXXXXX
09XXXXXX
1XXXXXXX
2XXXXXXX
3XXXXXXX
4XXXXXXX
5XXXXXXX
6XXXXXXX
7XXXXXXX
9XXXXXXX

Open in new window


These are some sample of the images, corresponding with their folder names.
001XXXXX
00100000.jpg
00101934.jpg
00103153.jpg
00199013.jpg

Open in new window

002XXXXX
00202549.jpg
00287068.jpg
00298070.jpg

Open in new window

09XXXXXX
09970234.jpg
09971079.jpg
09971795.jpg

Open in new window

1XXXXXXX
13523105.jpg
14002020.jpg
14050044.jpg
14050054.jpg

Open in new window


This will get the number of leading 0s.
<%strCLID = "00102348"%>
<%getCount = len(strCLID)-len(clng(strCLID)) &"-"& strCLID%>
getCount = 2

Open in new window


And for the long number: 14050054
The result is
-1

So, it would need to be something like this.

<%
if strNum="13523105" then
getFolder = "1XXXXXXX"
elseif strNum="03523105 then
getFolder = "03XXXXXX"
if strNum="93523105" then
getFolder = "9XXXXXXX"
if strNum="00523105" then
getFolder = "00XXXXXX"
elseif ......etc...
%>
This will be used in the image link
<img src="graph/item/<%=getFoldre%>/<%=getImage%>" />

Open in new window


Any ideas on this one?

Thanks, All
Carrzkiss
0
(I normally use classic asp for this) but would be willing to learn other options.  

I am creating a web form and want the following to occur:

Pick user name from dropdown (no problem, know how to do this)

Next dropdown is a list of holidays (ie Christmas, Thanksgiving etc)

I want the user to be able to pick a holiday, but not submit the form yet because I want them to answer questions for each holiday.

So if they pick the first holiday - ie Christmas - I then want a field or fields that show a calendar.  I want them to select the days they are closed for that holiday.  

Then another issue (question) would be if they are closed all day or partial day.  I really don't need the details of the partial day (ie 6 hours, closing 2 hours early etc) just that it's not all day.   At times they may select up to 4 days around Christmas that they are closed all day or partial days.

Then when they have finished Christmas I want them to move on to New Year's. Once finished then they click submit and submit the results to the database.  At this point how many columns would I set in the database - something like 6 columns to cover all scenerios?  Or if partial it goes into one column and if full day it goes into another column.  Not knowing what they will pick is an issue (for me).  I normally deal with standard answer type forms.

 They would only fill out this data once a year.  Normally I do a survey for each holiday but would really like to have this more automatic…
0
Using the PayPal sandbox environment, I am able to successful send an item for purchase to PayPal. PayPal displays the purchase screen with the correct information. I click the ‘Pay Now’ button and the transaction completes. The successful transaction shows in both the buyer and seller accounts.

PayPal returns to the specified url and has the PaymentID, Token, and PayerID.

The problem is there is nothing in the Response.Form. I search thru the items and there are no items. An objHTTP.Send returns INVALID from PayPal.
Using Telerik Fiddler, there is nothing being returned…other than the url items.

Below is the code I am using.

Thank you in advance for your assistance.

<%
Dim Item_name, Item_number, Payment_status, Payment_amount
Dim Txn_id, Receiver_email, Payer_email
Dim objHttp, str

Response.Write "PaymentID=" & Request.QueryString("PaymentID") & "*<BR>"
Response.Write "Token=" & Request.QueryString("Token") & "*<BR>"
Response.Write "PayerID=" & Request.QueryString("PayerID") & "*<BR>"

Response.Write "<table><tr><td>Name</td><td>Value</td></tr>"
For Each Item In Request.Form
    Response.Write "<tr><td>" & item & "</td><td>" & Request.Form(item) & "</td></tr>"
Next
Response.Write "</table>"
 
' read post from PayPal system and add 'cmd'
str = Request.Form & "&cmd=_notify-validate"

Response.Write "str: " & str & "*<BR>"
 
' post back to PayPal system to validate
' Note: either of these work
' SET objHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")

Open in new window

0
Hi EE Brainstrust,

I would like to do something like this however, cannot seem to make it work

If Request.QueryString("departure")>0 Then
	Set CatProdDep=oConn.Execute("SELECT * FROM prods,prod_deps WHERE prods.brand_ID='"&SubDomain("sites.brand_ID")&"' AND prods.prod_ID="&Request.QueryString("product"))
ElseIf Request.QueryString("product")>0 Then
	Set CatProdDep=oConn.Execute("SELECT * FROM prods,prod_deps WHERE prods.brand_ID='"&SubDomain("sites.brand_ID")&"' AND prods.prod_ID=prod_deps.prod_ID AND (dep_date>Now() OR ISNULL(dep_date)) AND prod_live=TRUE AND dep_live=TRUE AND prods.prod_ID="&Request.QueryString("product")&" ORDER BY dep_date")			
ElseIf Request.QueryString("category")>0 Then
	Set CatProdDep=oConn.Execute("SELECT * FROM prods,prod_deps WHERE prods.brand_ID='"&SubDomain("sites.brand_ID")&"' AND prods.prod_ID=prod_deps.prod_ID AND (dep_date>Now() OR ISNULL(dep_date)) AND prod_live=TRUE AND dep_live=TRUE AND (prod_type="&Request.QueryString("Category")&" OR dep_type="&Request.QueryString("Category")&") ORDER BY dep_date")
	Do Until CatProdDep.EOF		
End If

Response.Write("Data here<br>")

If Request.QueryString("departure")>0 Then
	response.write("departure")

ElseIf Request.QueryString("product")>0 Or Request.QueryString("category")>0 Then
	CatProdDep.MoveNext
		Loop	
End If

Open in new window


The Statements work in singular, pulled out of the IF statement, however I want to use a format that would be intricate and identical for all 3

If there a way to use it like this, but a different way to show it or is not possible?
0
I have an ASP page that connect to 3 different excel workbooks and pulls specific data from each and then dispays the results by user location. what I need to do now it make it so if there is something that has been labled as "open", which is one of the fields I pull from one of the spreadsheets I need the user to be able to click a link that will carry all the data from that particular row over to another page that will allow them to add a comment as to why the action is still open. once they enter a comment it would then take the row of information including the newly added comment and write it to an access database . The writing to the database part is easy, I can handle that but the getting the data from the first .asp page to the other is the part I am lost on.

This is the code from the header part of the page
<html>
<%


		vXlsFile = "/virtual/data/AU.xlsm"

		vXlsFile = Server.Mappath(vXlsFile)
		
		vXlsFile1 = "/virtual/documents/TechReport/ScholasticRecord.xlsm"
		vXlsFile1 = Server.Mappath(vXlsFile1)

		vXlsFile2 = "/virtual/documents/TechReport/PersonalInfo.xlsx"
		vXlsFile2 = Server.Mappath(vXlsFile2)
		
		
		
		
		ExcelConnString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
		"Data Source=" & chr(34) & vXlsFile & chr(34) & ";" & _
		"Extended Properties=" & chr(34) & "Excel 12.0;" & chr(34)
		
		'Response.write ExcelConnString
		'Open Database Connection
		Set Conn = Server.CreateObject("ADODB.Connection")
		Conn.Open ExcelConnString
		
		
		

Open in new window

0
i have the following code that display my calandar. I had to write it in asp/vbscript to comply with the actual solution


 <%

Dim currDate, nMonth, nDay, nYear
Dim lastMonth, lastYear, lastFirstDayPos, lastNumDays, submit
Dim numDays, monthName(13), count, pos, firstDayPos, eventDay, dayNum, cell(38)
Dim events(38)
Dim test1, test2, test3 ' used in leap year calcs
dim hideButton

If Request.Form("submit") <> "" Then

lastMonth = Int(Request.Form("lastMonth"))
lastYear = Int(Request.Form("lastYear"))
lastFirstDayPos = Int(Request.Form("lastFirstDayPos"))
lastNumDays = Int(Request.Form("lastNumDays"))
submit = Request.Form("submit")

End If

currDate = Date ' Date contains the current system date.
nMonth = Int(Month(currDate)) ' integer value 1 to 12
nDay = Int(Day(currDate)) ' integer value 1 to 31
nYear = Int(Year(currDate)) ' integer value yyyy
dayOfWeek = Int(Weekday(currDate)) ' integer values 1 to 7 (note diff from mini-SQL 0-6)


%>

<HTML>
<HEAD>
<TITLE>Calendar</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff" TEXT="#00000">
<CENTER>
<TABLE BORDER="1" cellspacing="2" CELLPADDING="2">

<%

' Previous or Next Month (passed values)

If submit = "Previous Month" Then
    nMonth = lastMonth - 1
    'nYear = lastYear -1
    If nMonth = 0 Then
        'nYear = nYear - 1
        nMonth = 12
    End If
end if


If submit = "Previous Month" Then
    nMonth = lastMonth - 1
    'nYear = lastYear -1
    If nMonth = 0 Then
        'nYear = nYear - 1
        nMonth = 12
    end if

Open in new window

0
what web server language for this code:

<!DOCTYPE html>
<html>
<body>
     <h1>Hello Web Pages</h1>
     <p>The time is @DateTime.Now</p>
</body>
</html>

I have a windows server that supports asp and asp.net but it's don't provide the date time. I try to change the file extension to asp or aspx but the problem stays.

thnaks a lot
0
Free Tool: ZipGrep
LVL 12
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

I’m using a script in asp to send email via CDOSYS. Works well but I’m sending in “from” with a hotmail address that has the name of the person perfectly configured inside hotmail details. Now when the mail arrives in the name of the from appears perfect the email address but the name changes like strange things that is not the name configured in hotmail details. For example a name of a person sometimes is vitamin, matchs, and so on... Why arrives like that (changing to strange things) the name of the persons on the hotmail from email?

For example I have a text like this:

to: anyemail@gmail.com
from: otheremail@hotmail.com
subject:This is a test. 

This is a final test

. 

Open in new window


On that txt Imcopy to pickup on IIs dir and how can Imforce to send a name on the from and also on cdosys?
0
I have 4 variables which they contain some values.

I have already convert them in numbers with CDbl.

So I have something like that:

var1=CDbl(str1)
var2=CDbl(str2)
var3=CDbl(str3)
var4=CDbl(str4)

Open in new window


How can I find the smallest number between var1, var2, var3 and var4?
0
Hi, Experts, I need to delete or drop my Database using .asp or vbscript command, how? My code below is not working, I'm having an error says, "-2147217865|[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot drop the database 'Jyle761234', because it does not exist or you do not have permission."

<%
On Error Resume Next

response.expires=-1

set cn=Server.CreateObject("ADODB.Connection")
cn.ConnectionString = "driver={SQL Server};Server=" & "winzServer" & "\SQLEXPRESS;uid=sa;pwd=3970;"
cn.Open

    cn.Execute "DROP DATABASE Jyle761234;"
    cn.Close
   
If Err.Number <> 0 Then
   response.Write(  Err.Number & "|" & Err.Description )
   response.End()
else
   response.write("Database has been deleted!")
   response.end()
end if
%>

Open in new window

0
I have an ASP page that pulls data in from several different excel forms and displays them by campus. for each different campus I make a new record set. once they are all displayed what I want to do is allow a user to click a link in their section that will then open another ASP page and carry over only the particular record they clicked the link on and be able to add a comment as to why the record is out of compliance. Below is the code I am currently using to display the data:

<html>
<%


		vXlsFile = "/virtual/data/AU.xlsm"

		vXlsFile = Server.Mappath(vXlsFile)
		
		vXlsFile1 = "/virtual/documents/TechReport/ScholasticRecord.xlsm"
		vXlsFile1 = Server.Mappath(vXlsFile1)

		vXlsFile2 = "/virtual/documents/TechReport/PersonalInfo.xlsx"
		vXlsFile2 = Server.Mappath(vXlsFile2)
		
		
		
		
		ExcelConnString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
		"Data Source=" & chr(34) & vXlsFile & chr(34) & ";" & _
		"Extended Properties=" & chr(34) & "Excel 12.0;" & chr(34)
		
		'Response.write ExcelConnString
		'Open Database Connection
		Set Conn = Server.CreateObject("ADODB.Connection")
		Conn.Open ExcelConnString
		
		
		XlsConnString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
		"Data Source=" & chr(34) & vXlsFile1 & chr(34) & ";" & _
		"Extended Properties=" & chr(34) & "Excel 12.0;" & chr(34)
		
		'Response.write ExcelConnString
		'Open Database Connection
		Set xConn = Server.CreateObject("ADODB.Connection")
		xConn.Open XlsConnString

	XlsxConnString = 

Open in new window

0
We cannot make a REST call using Classic ASP over TLS 1.2. This call is to get the authorization token from Paypal. We have tried lots of code variants with no success:

Example 1:
            Set xmlHttp = Server.CreateObject("WinHTTP.WinHTTPRequest.5.1")
            xmlHttp.Open "POST", "https://api.sandbox.paypal.com/v1/oauth2/token", False
            xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            xmlHttp.setRequestHeader "Accept", "application/json"
            xmlHttp.setRequestHeader "Accept-Language", "en_US"
            basico = "Basic " & Base64Encode(paypal_client_id & ":" & paypal_client_secret)
            xmlHttp.setRequestHeader "Authorization", basico <== "Invalid procedure call or argument"
            xmlHttp.Send "grant_type=client_credentials"

Example 2:
            Set xmlHttp = Server.Createobject("MSXML2.ServerXMLHTTP.6.0")
            xmlHttp.Open "POST", "https://api.sandbox.paypal.com/v1/oauth2/token", False
            xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            xmlHttp.setRequestHeader "Accept", "application/json"
            xmlHttp.setRequestHeader "Accept-Language", "en_US"
            basico = "Basic " & Base64Encode(paypal_client_id & ":" & paypal_client_secret)
            xmlHttp.setRequestHeader "Authorization", basico
            xmlHttp.Send "grant_type=client_credentials"  <== "An error occurred in the secure channel support"

Also, we've been able to make it with .NET and with PHP at the same server.
0
I am using a URL Rewrite, and have opted to use the title of the articles, as the URL.
Since the design of the site, of which was done back in 2014, I prepared the title to be used in this way.

NOW, the issue is this.
some of the articles have commas in the title.
So, the URL looks something like this.

/KISS_Concert_(Jan_10,_1985)

With a comma after the 10.

How can I pass this to my Query?
As of right now, it breaks at the comma.
So, it only sends to the page.

/KISS_Concert_(Jan_10

I have searched and have come up with nothing.
The only thing I can find is using:

%2C
/KISS_Concert_(Jan_10%2C_1985)

However, it still cuts off after the 10 in the name.

The only other option is to create a new column in the table, for the URL, and have it without a comma.
And leave the title as is, with the comma.
However, if there is a way, of which, there should be.
Heck, Microsoft has commas in their URLs, so we should be able to accomplish the same thing as well.
0
I have this code to send cdosys using windows server:

<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META http-equiv="Pragma" CONTENT="no-cache">




<title>Message sent</title>
<style type="text/css">
<!--
.BotonExit2 {
	color: #FFFFFF;
	background-color: #FF0000;
}
-->
</style>
</head>

<body> 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> 
<%
DIM strEmail
strEmail = Request.Form("Email")
IF strEmail <> "" AND inStr(strEmail,"@") <> 0 AND inStr(strEmail,".") <> 0 THEN



'First lets Dim all the variables we need

Dim emailfromr 

Dim email

Dim name

Dim message

Dim company

Dim telephone

Dim address1

Dim city

Dim state

Dim zip

Dim users

Dim app_name

Dim decision_time

Dim OS

Dim bandwidth

Dim DedicatedFirewall

Dim TapeBackup

Dim special_details

Dim MyBody

Dim MyMail

Dim MyEmail

Dim SmtpMail

Dim racecn

Dim cn
 

'Now lets get some values for the variables from the form

smtpserver = "127.0.0.1"

youremail = "myemailto@gmail.com"

yourpassword = "ADDYOURPASSWORD"

email = Request.Form("email")

emailfromr = "info@ourcompany.com"

If email = "" then email ="Invalid Mail"

name = Request.Form("name")

message = Request.Form("message")

company = Request.Form("company")

telephone = Request.Form("telephone")

address = Request.Form("address")

city = Request.Form("city")

state = Request.Form("state")

zip = Request.Form("zip")

users = Request.Form("users")

app_name = Request.Form("app_name")

decision_time = 

Open in new window

0
My site formally used a URL rewrite component called LinkFreeze to change the URL's to "SEO friendly URLs".
EX: 'www.mysite.com/category.asp?cat=3&subcat=2'  would be changed to  'www.mysite.com/category~3~subcat~2.asp'

Moving forward to 2018... I'm unable to use this component anymore so there are thousands of orphan URL's out there.  I wrote a simple script for a custom 404 page that redirects the URL to the correct (original) format of 'www.mysite.com/category.asp?cat=3&subcat=2'.  This works, but I was hoping there was a way to do a 301 redirect using URL Rewrite.  I'm open to any suggestions.
0
Hello I was working good and suddenly my windows server stopped sending emails via cdosys.asp and I found was list in CBL. They say: This IP address was detected and listed 85 times in the past 28 days, and 14 times in the past 24 hours. The most recent detection was at Thu Apr 5 15:05:00 2018 UTC +/- 5 minutes

The listing of this IP is because it HELOs as a bare IP address (A bare ip address looks like: "54.33.33.5"). It is not HELO'ing as itself ("xxx.xxx.xxx.xxx").

I have windows 2008 and almost we don’t send email just the normal reports of a LMS.

How can I fix the problem I just use my regular IP like years but suddenly stopped working.

Thank you
0
Cloud Class® Course: Ruby Fundamentals
LVL 12
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

I cannot figure out a Zero-String error on my web page. I am using an Access database for my Table and the Web page is an ASP page.
Below is the error message along with the line of code for the desired records. In the code, how do I correct the 'City" field.?
If the user does not enter anything in the field, the field should respond with a blank display.

Thank you for any help!
Rick

ERROR
insert into CAR (EditBy,Status,DateIssued,[Issued by],Title,Company,Contact,Phone,Fax,Email,Manufacturer,[Part Number],[ESC ID],PO,RMA,[Quantities Affected],[Description of Nonconformance],Containment,[Root Cause],CandP,[Corrective Action Date],[Due Date],[Reference Number],Address1,Address2,City,State,Zip,CityStateZip,Quan1,Lot1,Quan2,Lot2,Quan3,Lot3,Branch,ClosedDate,CompletedBy,ToFrom,ReviewOfEffectiveness) values ('BECKYS','Closed',NULL,'BECKYS','','','','','','','','','','','','','','','','',NULL,NULL,'','','','','','','','','','','','','','',NULL,'BECKYS','From: ES Components',NULL)
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Field 'CAR.City' cannot be a zero-length string.
/AllCARAdds.asp, line 79

CODE
var MM_fieldsStr = …
0
We are using the script below to redirect users who have Safari. Which our software does not support.
The script works perfectly on Mac OS computers and PC, but it redirects everyone when using ipad or iphone regardless to the fact they are using Firefox or Chrome.
How can we fix it so that it does not redirect on ipad/iphone unless they are using Safari?

function getBrowserName() {
    var name = "Unknown";
    if(navigator.userAgent.indexOf("MSIE")!=-1){
        name = "MSIE";
    }
    else if(navigator.userAgent.indexOf("Firefox")!=-1){
        name = "Firefox";
    }
    else if(navigator.userAgent.indexOf("Opera")!=-1){
        name = "Opera";
    }
    else if(navigator.userAgent.indexOf("Chrome") != -1){
        name = "Chrome";
    }
    else if(navigator.userAgent.indexOf("Safari")!=-1){
        window.location.href = "notsupported.html"
    }
    return name;   
}

if( getBrowserName() == "Safari" ){
    window.location.href = "notsupported.html";
}else{
   
}

Open in new window

0
I'm trying to set up an old website on my local windows 10 machine!
I've setup IIS and added the classic ASP module and If I use non database ASP pages
it works fine.  I've installed MySQL and setup ODBC with the proper driver and can access and test
the database fine!  
Its when I try access the database via ASP that it fails! The code I'm using worked fine on the web server.

This is the code that gives the error!
   
     Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
     Recordset1_cmd.ActiveConnection = "DSN=netcode;UID=peter;PSW=1234;"    *** This is the line that fails ***

I've also modified the read/write permissions on the INETPUB folder and all subfolders to full control!
And have modifier the users to full control as well!  

thanks

Pete
0
Hi Experts, I wish to obtain all Tables that is inside my database. I want to get their names and put it in the table. I have code below but I have no idea how do it. I have DataBase named, "MyDataBase"

<%

response.expires=-1

Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")

cn.ConnectionString = "driver={SQL Server};server=MyNoteBook\SQLEXPRESS;uid=sa;pwd=sa;database=" & "MyDataBase" & ""
cn.Open

%>

Open in new window

0
get data from database do normal
after then i don't know what to do
i found some example pages but i coudn't find fit answer for me
i am begginner so can u answer and explain the code?      
my goal is following this page https://datatables.net/examples/server_side/simple.html                        
<% if objrs.bof or objrs.eof then %>
						<tr align="center">
						<td colspan="5">글이 없습니다.</td>
						</tr>
						<%
							Else
							'게시물이 있으면 objrs로 현재 페이지와 페이지 크기에 따라 objrs 이동
							objrs.move(intNowpage-1) * intPageSize
							'계속해라 게시물이 끝날때까지
							do until objRs.eof
						%>
						<tr>
							<td><a href="content.asp?seq=<%=objRs(0)%>&page=<%=intNowPage%>&AscDesc=<%=AscDesc%>"><%=objrs(0)%></a></td>
							<td><a href="content.asp?seq=<%=objRs(0)%>&page=<%=intNowPage%>&AscDesc=<%=AscDesc%>"><%=objRs(3)%></a></td>
							<td><a href="content.asp?seq=<%=objRs(0)%>&page=<%=intNowPage%>&AscDesc=<%=AscDesc%>"><%=objRs(1)%></a></td>
							<td><%=left(objrs(5),10)%></td>
							<td><%=objrs(4)%></td>
						</tr>
						<% 
							'다음 objrs로 넘어감
							objrs.movenext
							loop
							end if
							objRs.close
							set objRs = nothing
							objDBConn.close
							set objDBConn = nothing
						%>

Open in new window

0
Using Classic ASP, is there a reliable way to redirect a user to another page on load if the user is using Safari?
0

ASP

81K

Solutions

31K

Contributors

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

Top Experts In
ASP
<
Monthly
>