Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help me convert an asp sql query to javascript

Status
Not open for further replies.

countrygirl35

Programmer
May 13, 2008
4
0
0
US
I'm relatively new to javascript and I have used asp for about a year. I'm trying to convert the asp script below to javascript so I can check at validation to see if a record exists for the input string. My code is below in asp.

Code:
<% checkforzip = "SELECT * FROM  IVRADM.T_SALES_LKP_Sales_Region WHERE Zip_Code = '" & strzip & "' "
 strspace = " "
 Set cnLink3 = Server.CreateObject("ADODB.Connection")
 cnLink3.Open "FILEDSN=D:\Inetpub\DSN\sale.dsn"
 
 set rsLink3 = Server.CreateObject("ADODB.Recordset")
 rsLink3.Open checkforzip, cnLink3, 3, 3
 
 If rsLink3.EOF Then
 response.redirect("zipnotcorrect.asp")
 Else
 rsLink3.Close
 Set rsLink3 = Nothing
 cnLink3.Close
 set cnLink3 = Nothing	
 End If %>

Then I have a form with a textbox that I retrieve the strzip value from...
 
As you can see, the code you posted has been completely munged. Perhaps you can use [ignore]
Code:
[/ignore] blocks to re-post it?

I'm surprised you didn't see that when you previewed the post...

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
You mean where supposed to preview our post's?






This is a Signature and not part of the answer, it appears on every reply.

This is an Analogy so don't take it personally as some have.

Why change the engine if all you need is to change the spark plugs.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top