Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 26th, 2005, 11:49 PM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default i need some Help please

Here's the code
31 uid=Request.QueryString("ID")
32 Set oConnection=Server.CreateObject("ADODB.Connection" )
33 Set rs1=Server.CreateObject("ADODB.Recordset")
34 oConnection.Open sConnString
35 sSQL="SELECT * FROM users WHERE uid=" & uid & ""
36 rs1.open sSQL, oConnection

 heres the error

Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'uid='.
/refferal/Default.asp, line 36
I need some help asap

 
Old January 27th, 2005, 04:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

sounds like you're getting nothing from Request.QueryString("ID")
 
Old January 27th, 2005, 04:31 PM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks so much i needed some help to stepback
the answer was
uid = Request.QueryString("uid")
not
uid = Request.QueryString("ID")

 
Old January 28th, 2005, 07:48 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

31 uid=Request.QueryString("ID")
32 Set oConnection=Server.CreateObject("ADODB.Connection" )
33 Set rs1=Server.CreateObject("ADODB.Recordset")
34 oConnection.Open sConnString
35 sSQL="SELECT * FROM users WHERE id=" & uid & ""
36 rs1.open sSQL, oConnection


surendran
(Anything is Possible)
 
Old January 28th, 2005, 01:52 PM
Authorized User
 
Join Date: Jan 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

If uid is declared as string in DB then the syntax will be :

  sSQL="SELECT * FROM users WHERE uid='" & uid & "'"

If uid is declared as int in DB then the syntax will be :
   sSQL="SELECT * FROM users WHERE uid=" & uid



Hope It Helps !!
Bhaskar Ghosh









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.