patwong
-
Total Posts
:
1
- Scores: 0
-
Reward points
:
0
- Joined: 1/2/2006
-
Status: offline
|
Big problem in ASP using procedure variable to select statement
Wednesday, December 15, 2010 8:05 PM
( permalink)
Variable can get from procedure and show alert but NIL use to select statement. Result already show 'No record found' but really have the record in table. Does anyone can help !. <input type="button" height="20" value="Chk bldg" onClick="call checkbldg(txtaddress1.value)" language="vbscript"/> <Script Language="VBScript"> Sub checkbldg(xadr) <% strDSN = "provider=MSDAORA;data source=muDB;user id=temp;password=123" Set cn = Server.CreateObject("ADODB.Connection") cn.Open strDSN Set rsPublic = Server.CreateObject("ADODB.Recordset") strSQL = "select count(*) from table where user='" & xadr & "'" On Error Resume Next set rsPublic = cn.Execute(strSQL) if rsPublic.EOF then %> alert "No record found" <%else %> alert "Record found" <%end if%> end sub </Script>
|
|
|
|