Re: Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Jack (Jack_at_discussions.microsoft.com)
Date: 12/13/04


Date: Mon, 13 Dec 2004 10:45:15 -0800

Thanks for the detailed help. Really appreciate it. Thanks.

"Bob Barrows [MVP]" wrote:

> Jack wrote:
> > Hi, I am trying to connect to a local Access Data from
> > a ASP page. I do not have the latest version of JET 4.0 installed.
>
> Why not?
>
> > Hence I am trying to use the native ODBC driver for Access:
>
> When you get it installed, you'll want to change the connection string to
> use the native Jet OLEDB provider.
>
> > The
> > following is the code for opening the sql. The z_SpecialCondition
> > query is an Access query which is basically 'select * from
> > SpecialCondition'. However, when I am trying to run the ASP page I am
> > getting the following error
> > message given below. I would like to know, why is this error message
> > coming. Thanks.
> >
> >
> > <%
> > myDSN="DRIVER={Microsoft Access Driver (*.mdb)}; "
> > myDSN=myDSN & "DBQ=C:\_______GWISNEWCON\GMISDATA.mdb"
> >
> > set CN=server.createobject("ADODB.Connection")
> > set RS=server.createobject("ADODB.Recordset")
> > CN.Open myDSN
> > RS.ActiveConnection=CN
>
> This should be:
> Set rs.activeconnection=cn
>
> By failing to use Set, you cause a new connection to be opened. Better yet,
> delete this line entirely.
>
> > SQL = "z_SpecialCondition"
>
> This should be
> "Select <list of columns, do not use * in production code> from " & _
> "z_SpecialCondition"
>
> > RS.Open SQL
>
> If you take my advice about deleting the ActiveConnection line, this line
> should be:
>
> rs.open sql,cn,,,1
>
> Once you get Jet 4.0 installed, you will be able to use this syntax to open
> your saved queries:
>
> cn.z_SpecialCondition rs
>
> See these posts for more info:
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&selm=eHYxOyvaDHA.4020%40tk2msftngp13.phx.gbl
>
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&selm=ukS%246S%247CHA.2464%40TK2MSFTNGP11.phx.gbl
>
> http://www.google.com/groups?selm=eETTdnvFDHA.1660%40TK2MSFTNGP10.phx.gbl&oe=UTF-8&output=gplain
>
> Bob Barrows
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
>



Relevant Pages

  • RE: Lsass.exe - when trying to update a password.
    ... Shortly before this error message, i lost all use of network ... > Thank you for posting to the SBS Newsgroup. ... What exact password you trying to update? ... > Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • Re: Exchange not creating users
    ... Base research on your error message, I suggest we try the following steps: ... Please install latest updates and service packs on your Exchange ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • RE: Lsass.exe - when trying to update a password.
    ... Mine is/was a Dell pre-installed windows 2003sbs ... Shortly before this error message, i lost all use of network ... >> Thank you for posting to the SBS Newsgroup. ... >>>connections and the server could not access anyone, ...
    (microsoft.public.windows.server.sbs)
  • Re: Error when installing SQL server 200 on SBS 2003
    ... it seems this newsgroup is helpful to all the SBS ... Microsoft CSS Online Newsgroup Support ... Error when installing SQL server 200 on SBS 2003 ... | In fact I got the same error message when upgrading to SQL SP4 ...
    (microsoft.public.windows.server.sbs)
  • RE: Server Error in /Remote Application
    ... Parser Error Message: Assembly remote.dll security permission grant set is ... > This newsgroup only focuses on SBS technical issues. ... you may want to contact Microsoft CSS directly. ... An unhandled exception occurred during the execution of the ...
    (microsoft.public.windows.server.sbs)