Print Page | Close Window

Noob help- SQL syntax

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=10664
Printed Date: 30 March 2026 at 12:10pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Noob help- SQL syntax
Posted By: oneminuteguy
Subject: Noob help- SQL syntax
Date Posted: 29 May 2004 at 10:05am

I have a request.form. Users view their information by typing their phone number. Works fine, but I need to know how to create a user friendly error message when the phone field is empty. Here's my code:

<%
  'variables
  dim Conn, Connstring, Sql_Get, TheArray, Recordset
 
  'database connection
  Set Conn = Server.CreateObject("ADODB.Connection")
  Conn.Provider = provider
  Conn.ConnectionString = dbasepath
  Conn.Open

' Sql statement
  Sql_Get="SELECT * FROM tblFestival WHERE Phone='" & Request.Form("Phone") & "'"

Set Recordset = Conn.Execute(Sql_Get)

' get the recordset data in memory using getrows()
  TheArray = RecordSet.Getrows

' Cleanup objects
  Conn.Close
  Set Conn = Nothing
  Set RecordSet = Nothing
   %>

Any help much appreciated. Sorry if this is a noob-q, but I'm kinda stuck.

Thanks,
OMG




Replies:
Posted By: michael
Date Posted: 29 May 2004 at 10:13am
Just add,
If TheArray = Nothing THEN
 'Either a javascript box or a response.write popping the message
END IF

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: oneminuteguy
Date Posted: 29 May 2004 at 10:32am
Hi and thx for answering,

Exactly where should I put this?



Posted By: Mart
Date Posted: 29 May 2004 at 2:16pm
YOu could put it at the bottom



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net