ok, i have a problem with a SQL command.
I have created a table in my database called netfile with three column, user, pass, dir.
When i run
the command:
SELECT dir FROM netfile WHERE user='core33' AND pass='test33'
Nothing happens
when i run;
SELECT dir FROM netfile WHERE pass='test33'
It returns correctly
when i run;
SELECT dir FROM netfile WHERE user='core33'
Nothing Happens.
Can someone look through this code and see why when i search for a record by the USER column it doesn't detect it but where i search via the PASS column it finds it???
-----------------------------------------
All the columns are 50,CHAR in the database
VB Code:
<%@ Page Language = "VB" Trace = "true" %> <%@ import Namespace="System.IO" %> <%@ import Namespace="System.Data.SqlClient" %> <Script Runat="server"> Function Scriptname as string Dim strURL,aryURL strURL = Request.ServerVariables("SCRIPT_NAME") aryURL = Split(strURL, "/", -1, 1) Scriptname = (aryURL(ubound(aryURL))) End Function Sub Page_Load 'DB stuff Dim SQLcon As SqlConnection, SQLcmd as SqlCommand, SQLread as SqlDataReader SQLcon = New SqlConnection ( "Server=xxx.mysite4now.com;uid=xxx;pwd=xxx;database=xxx") SQLcon.Open() SQLcmd = New SqlCommand( "SELECT dir FROM NetFile WHERE user='core33' AND pass='test112'", SQLcon ) SQLread = SQLcmd.ExecuteReader() While SQLread.Read() Response.Write( SQLRead( "dir" ) ) End While SQLread.Close() SQLcon.Close() End Sub </script>




Reply With Quote