[thelist] Pass ASP query string to SQL statement

Ken Schaefer Ken at adOpenStatic.com
Sat Aug 11 06:49:44 CDT 2007

a) This code isn't very good because you are implicitly opening an ADO Connection object. How are you going to close/dispose of that object?

Instead, explicitly open a connection object, then dispose of it when you don't need it

b) The Jet OLEDB Provider is far more robust than the Access ODBC driver that you are using. The ODBC driver stopped being developed many years ago

c) Don't use "magic numbers" - if you need to, include a reference to the ADO type library, and then you can use named constants.

CursorType = 1 is adOpenKeyset. Not supported by Access
CursorLocation = 1 is undefined. The only valid values are adUseClient (3) and adUseServer (2)

Check my site if you want to background reading on cursors etc


-----Original Message-----
From: thelist-bounces at lists.evolt.org [mailto:thelist-bounces at lists.evolt.org] On Behalf Of Groups at beachcomp.com
Sent: Saturday, 11 August 2007 8:41 AM
To: thelist at lists.evolt.org
Subject: [thelist] Pass ASP query string to SQL statement

I have
vidid = request.querystring("id")
MY_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=\videos.mdb"
Server.ScriptTimeout = 180
Dim videos
Set videos = Server.CreateObject("ADODB.Recordset")
videos.ActiveConnection = MY_STRING
videos.Source = "SELECT * FROM videos where active=Yes and Id ='" & vidid &
videos.CursorType = 1
videos.CursorLocation = 1
videos.LockType = 1
But I get:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

ODBC driver does not support the requested properties.

Could anyone point me in the right direction?


|Beach Computers                    |
|Affordable Hosting Solutions       |
|http://www.beachcomp.com           |
|Cheap Domain Warehouse             |
|Get Your Own Dot!                  |

Disclaimer and confidentiality note:

The contents of this communication are intended/meant only for addressee(s)
and may contain information that is privileged or otherwise confidential.
If you are not the intended recipient you are hereby notified that any
disclosure, copying, distribution or taking any action in reliance on the
contents of this information is strictly prohibited and may be unlawful.
The contents of this e-mail shall not be forwarded to any third party. If
you have received this electronic mail transmission in error, please delete
it from your system without copying or forwarding it, and notify the sender
of the error by reply email, so that the sender's address records
can be corrected.
Views and opinions are solely those of the sender unless clearly indicated
as being that of Beach Computers or any of it's affiliated companies.
Beach Computers cannot assure that the integrity of this communication has
been maintained or that it is free of errors, virus, interception or
-----Original Message-----
From: list-bounces at webdesign-l.com [mailto:list-bounces at webdesign-l.com] On
Behalf Of Lea de Groot
Sent: Thursday, August 09, 2007 2:21 AM
To: Web Design List
Subject: Re: [WD]: 'stuck' rss feed at google?

On Wed, 8 Aug 2007 08:52:22 -0500, Austin, Darrel wrote:
> It looks like we might just have to change the URL of our feeds. Which
> kind of sucks.

Just to make sure the 'dumb' questions have been asked... :)
I assume you have checked that Google is able to reach your feed file,
and nothing has changed to stop it?
It definitely happens!

Lea de Groot
Elysian Systems
Brisbane, Australia

  more info about webdesign-l: http://webdesign-L.com/
               to unsubscribe: http://webdesign-L.com/mailman/listinfo/list
  If you had read the list policies: http://webdesign-L.com/policies/
 you'd know not to "top post": http://en.wikipedia.org/wiki/Top-posting
     That means that if this line here is in your reply, you lose.


* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !

More information about the thelist mailing list