Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: SV: RE: Autonumber Heck


Message #1 by "Jan Arve Dyrnes" <jan.arve@c...> on Wed, 27 Feb 2002 13:58:10 +0100
Hi,



Try to write out your sql statement as a response.write and tell us the

result:



jana



-----Opprinnelig melding-----

Fra: M. May [mailto:mmay@b...]

Sendt: 27. februar 2002 12:41

Til: ASP Databases

Emne: [asp_databases] RE: Autonumber Heck





Well, I renamed ID as tickId, so now the sql statement ends thusly:

     WHERE tickId = "&ticketNumbFromForm

Unfortunately, now I'm back to getting the syntax error:

     [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing

operator) in query expression 'tickId ='.





> I *believe* ID is a reserved word that you should not use.  You should

> rename the field in your form, perhaps to "TID" (for Ticket ID).  I

> think that is what your problem is.  After you have renamed it, then

> since this is a number field, you do not want to surround it with

> quotes, so this is the correct way to end the SQL string:

>

> WHERE TID=" & ticketNumbFromForm

>

> Hope this helps.

> Pete

>

>

> > -----Original Message-----

> > From: M. May [mailto:mmay@b...]

> > Sent: Tuesday, February 26, 2002 11:22 PM

> > To: ASP Databases

> > Subject: [asp_databases] Autonumber Heck

> >

> >

> > Greetings Folks:

> >

> > I'm having a devil of a time searching throught an Access Db,

> > where the

> > item i'm searching for is an autogenerated item. I believe

> > I've followed

> > every suggestion I've found on this board, but I may have overlooked

> > something.

> >

> > ID is autogenerated.

> > ticketNumbFromForm is a number input by the end user.

> >

> > ===begin code snippet===

> > 'open connection to ticket db

> > set connect = server.createobject("ADODB.connection")

> > connect.connectionstring = "DSN=cpeTrack"

> > connect.open

> >

> > strSql = "SELECT

> > dateOpened,openedByEmail,openedByTechNumb,jobNumb,typeOfEscala

> > tion,cpeType,

> > cpeDateOfIssue,cpeSerialNumb,acctNumb,billingSys,town,warehous

> > e,fma,escalat

> > ionSentTo,closedBy,dateClosed,duration,comments,resolution,opN

> > umb FROM

> > ticketTrack WHERE ID = "&ticketNumbFromForm

> > set recset = server.createobject("ADODB.Recordset")

> > recset.open strSql, connect

> > ===end code snippet===

> >

> > when strSql ends as above, i get a syntax error [Syntax error

> > (missing

> > operator) in query expression 'ID ='.]

> >

> > when strSql end like this - WHERE ID 

> > '"&ticketNumbFromForm&"'" - i get

> > the type mismatch error[Data type mismatch in criteria expression.]

> >

> > I'd be pulling out my hair, except I shaved it all off...




> > $subst('Email.Unsub').

> >






$subst('Email.Unsub').








  Return to Index