PDA

View Full Version : Expected ')' ?


mattboy_slim
03-17-2003, 07:24 PM
Getting this error, and don't know where the issue lies:

Microsoft VBScript compilation error '800a03ee'

Expected ')'

/dickinson/_admin/links.asp, line 56

Set catsRec = objConn.Execute ("SELECT Name FROM cats WHERE catid = " 1 ";)
----------------------------------------------------------------------^

Thanks.

oracleguy
03-17-2003, 07:25 PM
Set catsRec = objConn.Execute ("SELECT Name FROM cats WHERE catid = '1';")


Try that.

You were ending the string, you need to use single quotes around parameters in a string.

mattboy_slim
03-17-2003, 07:27 PM
Wow, that was fast. I no more than closed my browser window and I got an email telling me that someone had replied.

That worked. Thanks much.

Now I'm getting a "Data type mismatch in criteria expression", but that's a different problem.

Thanks again, this place is awesome.

raf
03-17-2003, 07:34 PM
I presume the catid is a numeric variable, so drop the quotes.

One question : why did you close your browser?:confused:

Roy Sinclair
03-17-2003, 07:38 PM
Originally posted by mattboy_slim
Wow, that was fast. I no more than closed my browser window and I got an email telling me that someone had replied.

That worked. Thanks much.

Now I'm getting a "Data type mismatch in criteria expression", but that's a different problem.

Thanks again, this place is awesome.

Data type mismatch tells me you don't need the quotes at all:


Set catsRec = objConn.Execute ("SELECT Name FROM cats WHERE catid = 1;")


Quick responses are subject to when people check the board, sometimes you get lucky and other times you have to wait a while.

mattboy_slim
03-17-2003, 07:39 PM
Oh jeez, thanks Raf. I wasn't even going to worry about that problem until later this afternoon. You saved us all time though, because I would have just came back here in 3 hours and asked anyways. But yes, that worked. It was a numeric value.

As for your question: Because I'm at work. Where I work, browsers on outside sites = bad.

This forum never ceases to amaze me.

raf
03-17-2003, 07:49 PM
Mr. Sinclair,

And sometimes were so fast and eager and you get the right answer two times in 5 minutes.
but you shouldn't use explicti or implicit language sometimes you get lucky and other times you have to wait a while.
A dirty mind is a joy forever.:D

matboy_slim,

browsers on outside sites=timesavers.

oracleguy
03-17-2003, 07:57 PM
Oops I should of thought about the whole quotes thing. But at least others caught my mistake. I should of paid attention to the field name. :o

raf
03-17-2003, 08:19 PM
i'm just curious:
do you need the ; at the end of the statement (like at the end of commands in most languages)? It looks good for short sql statements

i allways go

sql="SELECT ID FROM table"
rsOrders.Open sql, Conection

Bit longer but easier to debug.

Also. I always use "Open" for recordsets and "Execute" for other manipulations. I learned it this way, but i'm not sure why/if this is recomended.
Anyone knows for sure when to choose open/execute ?

mattboy_slim
03-17-2003, 08:21 PM
That's beyond me. I just do what Dreamweaver tells me to do. I still do cheaters programming. I'm not yet to the point where I know to use one thing or the other, as a matter of fact, I'm not sure I ever will be. I swear every day this stuff seems more complicated than the previous day.

raf
03-17-2003, 08:35 PM
Hey, you sound like a perceptive guy.:D
Dump Dreamweaver if you want to learn programming. Realy. We're here to help you.

Otherwise you'll run into all sorts a problems you (and Dreamweaver itself) woun't understand.

mattboy_slim
03-17-2003, 08:46 PM
Well I'm not sure I want to learn programming. I'm an "Air-Nailer over a hammer" guy. Not a perfect analogy, but you get what I mean. I know I need to learn it, but I'm not exactly pumped for it if you know what I mean.

Pieces at a time...

brothercake
03-17-2003, 08:56 PM
Originally posted by mattboy_slim
Pieces at a time...

I totally sympathise. I have a non-mathematical and non-scientific background; in art, music and generally aesthetic, rathen than rational; emotive rather than logical. Three years ago I didn't even know you had to "shut-down" a computer, rather than just turn it off.

It's a mind bender alright. But what really hooked me was - firstly the potential for being able to communicate through the internet; and secondly, a sudden realisation -

You can make anything you want - anything at all - you just have to find a way of expressing it in pure logic :)

raf
03-17-2003, 09:09 PM
Well. I'm not gonna force you.
One of the other users motto was:
"To a man with only a hamer in his toolbox, every problem looks like a nail".
Now, a hammer can be at least be used for a few other jobs, but an Air-Nailer ?

The more i learn about coding, the less i wonder "but how did they do that?". (Of coarse, there's also the money, lady's, ...)

The best thing you can do with your money is let other people work for you, so if we can help you out ...
:D

mattboy_slim
03-17-2003, 09:15 PM
If I had money, I surely wouldn't be working for someone...