troubleshooting Question

How do I Run a SQL Query in ASP?

Avatar of bcarrolluk
bcarrolluk asked on
Microsoft SQL ServerASP
6 Comments1 Solution1447 ViewsLast Modified:
Ok, so far i have this



------

Ok so what  i need is for some way to take the data that the is entered into the text box at the top of the page and then run it in the SQL query, the query just searches for that phonenumber and brings back the number and the operator.

Then once i have that, i need it to write the Phonenumber and the Operator into a table..

Any help is appreciated :)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CPS LCR Customer List</title>
</head>
 
<body>
 
<form id="form1" name="form1" method="post" action="">
  <label>
  <input type="text" name="Text" id="Text" />
  Please Enter the CPS / LCR Number</label>
</form>
<%
 
if len(request.form("Text")) <> "11" then
      response.write("Error - Please Enter an 11 Digit Number") 
      
else
     response.write("")
end if
 
 
set Con = Server.CreateObject("ADODB.Connection")
con.open "File Name=" & Server.MapPath("EbillzSQL.UDL")
 
SQL = "SELECT CustomerIdentifier, Operator From LCRCustList Where CustomerIdentifier = '" & request.form("Text")& "'"
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros