-
Syntax Error
I am trying to query ID (Number Field), UserID (Text Field), Password (Text Field) and I continue to receive a syntax error.
Is there something that I am doing wrong?
My code:
<body>
<%
Set MyDb=Server.CreateObject("ASPdb.Pro" 'Create the ASP-db object
MyDb.dbQuickProps="2071;StudentDatabase1;;both ;4,both" 'Set its std properties
MyDb.dbSQL = "SELECT * from Userdb WHERE ID=" & Request ("ID" & " AND UserID='" & Request ("UserID" & "' AND Password = '" & Request ("Password" & "'"
MyDb.dbNavigationItem="filter, Next, Prev"
MyDb.dbNavigation="Both"
MyDb.dbUnit = 8
MyDb.dbgridDisplayFlds= "0,1,2,3,4"
MyDb.dbStatusBar=True
MyDb.dbRecordCount=5000
MyDb.dbGridInc=50
MyDb.ASPdbPro 'Call ASPdb to do its magic!
%>
Your help is greatly appreciated.
-
Syntax Error (reply)
John,
I made the changes you suggested and I get the same error message:
Platform
GridInc before QP=50
DBType=ACCESS
UserQstr:
Main: Q=..U=..V=..W=..UE=..US=
Main: Not alive
New session: SQL=SELECT * from Userdb WHERE ID= AND UserID='' AND Password=''
Connection=StudentDatabase1
Alive, Get Connection: NewSession=True/True
Get_Connection: New connection: StudentDatabase1
Main: New session
Regular Color - #ffffff/#ffffff/#009900/#006600///
Grid: Entering
Show Grid: SX, mode, SQL=_8/grid/SELECT * from Userdb WHERE ID= AND UserID=''
AND Password=''
mySQL in Get_OrderBY=SELECT * from Userdb WHERE ID= AND UserID='' AND
Password=''
tail,p1=/61
heads=SELECT * from Userdb WHERE ID= AND UserID='' AND Password=''/
Show Grid: Sort Name V=
Grid: mySQL SELECT * from Userdb WHERE ID= AND UserID='' AND Password=''
Show_Gridagesize,RScount,Gridinc=50/0/50
PT=GridPtr/Pagesize/FormPtr=0/50/0
PT right before move = 0
Grid SQL=SELECT * from Userdb WHERE ID= AND UserID='' AND Password=''
Get_RS: Entering mode=both
Begin Setfilterinsql, filter=SELECT * from Userdb WHERE ID= AND UserID='' AND
Password=''/
Get_RS_OPEN: Entering GET_RS_OPEN
Get_RS_OPEN: mySQL in memory=SELECT * from Userdb WHERE ID= AND UserID=''
AND Password=''
Get_RS_OPEN: High speed TOP
TOPSQL=SELECT TOP 50 * from Userdb WHERE ID= AND UserID='' AND Password=''
Get_RS_OPEN: Before Reset ROWCOUNT
Into ROWCOUNT
Get_RS_OPEN: SQL=SELECT TOP 50 * from Userdb WHERE ID= AND UserID='' AND
Password=''
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access 97 Driver] Syntax error (missing operator) in query expression 'ID=
AND UserID='' AND Password='''.
/e_port/TestEdit.asp, line 23
<%
Set MyDb=Server.CreateObject("ASPdb.Pro"
Mydb.dbDSN="StudentDatabase1"
MyDb.dbColor = "7,auto"
MyDb.dbMode = "both"
MyDb.dbSQL = "SELECT * from Userdb WHERE ID=" & Request ("ID" & " AND UserID='" & Request ("UserID" & "' AND Password='" & Request ("Password" & "'"
MyDb.dbNavigationItem="filter, Next, Prev"
MyDb.dbNavigation="Both"
MyDb.dbUnit = 8
MyDb.dbgridDisplayFlds= "0,1,2,3,4"
MyDb.dbStatusBar=True
MyDb.dbRecordCount=5000
MyDb.dbGridInc=50
MyDb.dbDebug=True
MyDb.ASPdbPro
%>
On 3/1/99 8:13:37 AM, John wrote:
> Hi,
First thing is that I think you have a syntax in your dbQuickProps
> property. You have "both;4,both" in there. Do you mean
> "both;4,auto" ?
Second, if this doesn't work, skip the
> quickprops and put each property on a line by itself (dbUnit, dbMDB, dbSQL,
> dbMode, dbColor).
Third, you say you get a syntax error. Print out the
> error message, and also turn on debugging (MyDb.dbDebug=true). This may
> help point out the error.
Thanks,
John
On 2/26/99 4:49:37 PM, J
> Williams wrote:
> I am trying to query ID (Number Field), UserID (Text
> Field), Password (Text
> Field) and I continue to receive a syntax error.
>
Is there something that
> I am doing wrong?
My
> code:
<body>
<%
Set
> MyDb=Server.CreateObject("ASPdb.Pro"
>
> 'Create the ASP-db object
>
> MyDb.dbQuickProps="2071;StudentDatabase1;;both ;4,both" 'Set
>
> its std properties
MyDb.dbSQL = "SELECT * from Userdb WHERE
>
> ID=" & Request ("ID" & " AND UserID='" &
> Request
> ("UserID" & "' AND Password = '" &
> Request
> ("Password" & "'"
>
MyDb.dbNavigationItem="filter,
> Next, Prev"
> MyDb.dbNavigation="Both"
> MyDb.dbUnit = 8
> MyDb.dbgridDisplayFlds= "0,1,2,3,4"
>
> MyDb.dbStatusBar=True
MyDb.dbRecordCount=5000
>
>
MyDb.dbGridInc=50
MyDb.ASPdbPro
>
> 'Call ASPdb to do its magic!
>
>
%>
Your help is greatly appreciated.
-
Syntax Error (reply)
The problem's pretty clear once you look at the dbSQL you're creating. Apparently, Request("ID" is coming back BLANK. Look at your SQL:
On 3/1/99 11:10:14 AM, J Williams wrote:
> John,
I made the changes you suggested and I get the same error
> message:
SQL=SELECT TOP 50 * from Userdb WHERE ID= AND UserID='' AND Password=''
There's nothing there for ID= ! It should be ID='' or something right?
Maybe you should put the value in a variable and if it's empty, set it to zero or something?
I.E.
myID = Request("ID"
If MyID = "" then MyID = 0
Then user MyID in your SELECT statement.
Good luck,
John
Platform
GridInc before QP=50
DBType=ACCESS
UserQstr:
>
Main: Q=..U=..V=..W=..UE=..US=
Main: Not alive
New session: SQL=SELECT
> * from Userdb WHERE ID= AND UserID='' AND
> Password=''
Connection=StudentDatabase1
Alive, Get Connection:
> NewSession=True/True
Get_Connection: New connection:
> StudentDatabase1
Main: New session
Regular Color -
> #ffffff/#ffffff/#009900/#006600///
Grid: Entering
Show Grid: SX, mode,
> SQL=_8/grid/SELECT * from Userdb WHERE ID= AND UserID=''
AND
> Password=''
mySQL in Get_OrderBY=SELECT * from Userdb WHERE ID=
> AND UserID='' AND
Password=''
tail,p1=/61
heads=SELECT *
> from Userdb WHERE ID= AND UserID='' AND Password=''/
Show
> Grid: Sort Name V=
Grid: mySQL SELECT * from Userdb WHERE ID= AND
> UserID='' AND
> Password=''
Show_Gridagesize,RScount,Gridinc=50/0/50
PT=GridPtr/
> Pagesize/FormPtr=0/50/0
PT right before move = 0
Grid SQL=SELECT * from
> Userdb WHERE ID= AND UserID='' AND Password=''
Get_RS:
> Entering mode=both
Begin Setfilterinsql, filter=SELECT * from Userdb WHERE
> ID= AND UserID='' AND
Password=''/
Get_RS_OPEN: Entering
> GET_RS_OPEN
Get_RS_OPEN: mySQL in memory=SELECT * from Userdb WHERE ID=
> AND UserID=''
AND Password=''
Get_RS_OPEN: High speed
> TOP
TOPSQL=SELECT TOP 50 * from Userdb WHERE ID= AND UserID='' AND
> Password=''
Get_RS_OPEN: Before Reset ROWCOUNT
Into
> ROWCOUNT
Get_RS_OPEN: SQL=SELECT TOP 50 * from Userdb WHERE ID= AND
> UserID='' AND
Password=''
Microsoft OLE DB Provider for
> ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access
> 97 Driver] Syntax error (missing operator) in query expression
> 'ID=
AND UserID='' AND Password='''.
>
/e_port/TestEdit.asp, line 23
<%
Set
> MyDb=Server.CreateObject("ASPdb.Pro"
> Mydb.dbDSN="StudentDatabase1"
MyDb.dbColor =
> "7,auto"
MyDb.dbMode = "both"
MyDb.dbSQL =
> "SELECT * from Userdb WHERE ID=" & Request ("ID" & "
> AND UserID='" & Request ("UserID" & "' AND
> Password='" & Request ("Password" & "'"
> MyDb.dbNavigationItem="filter, Next, Prev"
> MyDb.dbNavigation="Both"
MyDb.dbUnit = 8
> MyDb.dbgridDisplayFlds= "0,1,2,3,4"
MyDb.dbStatusBar=True
> MyDb.dbRecordCount=5000
> MyDb.dbGridInc=50
MyDb.dbDebug=True
MyDb.ASPdbPro
>
%>
On 3/1/99
> 8:13:37 AM, John wrote:
> Hi,
First thing is that I think you have a
> syntax in your dbQuickProps
> property. You have "both;4,both"
> in there. Do you mean
> "both;4,auto" ?
Second, if this
> doesn't work, skip the
> quickprops and put each property on a line
> by itself (dbUnit, dbMDB, dbSQL,
> dbMode, dbColor).
Third, you say
> you get a syntax error. Print out the
> error message, and also turn on
> debugging (MyDb.dbDebug=true). This may
> help point out the
> error.
Thanks,
John
On 2/26/99 4:49:37 PM, J
> Williams wrote:
>
> I am trying to query ID (Number Field), UserID (Text
> Field), Password
> (Text
> Field) and I continue to receive a syntax error.
>
Is there
> something that
> I am doing wrong?
My
> code:
<body>
<%
Set
>
> MyDb=Server.CreateObject("ASPdb.Pro"
>
>
> 'Create the ASP-db object
>
>
> MyDb.dbQuickProps="2071;StudentDatabase1;;both ;4,both" 'Set
>
>
> its std properties
MyDb.dbSQL = "SELECT * from Userdb
> WHERE
>
> ID=" & Request ("ID" & " AND
> UserID='" &
> Request
> ("UserID" & "' AND
> Password = '" &
> Request
> ("Password" &
> "'"
>
MyDb.dbNavigationItem="filter,
> Next,
> Prev"
> MyDb.dbNavigation="Both"
>
> MyDb.dbUnit = 8
> MyDb.dbgridDisplayFlds= "0,1,2,3,4"
>
>
> MyDb.dbStatusBar=True
MyDb.dbRecordCount=5000
>
>
>
MyDb.dbGridInc=50
> MyDb.ASPdbPro
>
>
> 'Call ASPdb to do its magic!
>
>
%>
Your help is
> greatly appreciated.
-
Syntax Error (reply)
John,
Once again, I have tried the suggestion and no luck. Would it have
to do anything with ID being an autonumber?
Here is the code I posted again:
<body>
<%
MyID = Request("ID"
If MyID = "" then MyID = 0
%>
<%
Set MyDb=Server.CreateObject("ASPdb.Pro"
Mydb.dbDSN="StudentDatabase1"
MyDb.dbColor = "7,auto"
MyDb.dbMode = "both"
MyDb.dbSQL = "SELECT * from Userdb WHERE myid=" & Request ("myid" & " AND UserID='" & Request ("UserID" & "' AND Password='" & Request ("Password" & "'"
MyDb.dbNavigationItem="filter, Next, Prev"
MyDb.dbNavigation="Both"
MyDb.dbUnit = 8
MyDb.dbgridDisplayFlds= "0,1,2,3,4"
MyDb.dbStatusBar=True
MyDb.dbRecordCount=5000
MyDb.dbDebug=True
MyDb.ASPdbPro
%>
<form method="get" action="TestEdit.asp" onsubmit="return FrontPage_Form1_Validator(this)"
name="FrontPage_Form1">
<p>ID <!--webbot bot="Validation" startspan S-Data-Type="Number"
S-Number-Separators=",." --><!--webbot bot="Validation" endspan --><input type="text"
name="ID" size="20" value="<%=TheValue("ID"%>"></p>
<p>UserID <input type="text" name="UserID" size="20"></p>
<p>Password: <input type="password" name="Password" size="20"></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset"
name="B2"></p>
<p> </p>
</form>
</body>
-
Syntax Error (reply)
John
I think I may have found my problem. I had the form submitting to itself and I change it by making a seperate form that submitts to the asp page. Now everything works out. I was starting to think I was just loosing it. Should this make that much of a difference?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|