Irish-Phoenix wrote:
> Error Message:
> Error Diagnostic Information
> ODBC Error Code = 07001 (Wrong number of parameters)
>
>
> [Microsoft][ODBC Microsoft Access Driver] Too few
parameters. Expected 1.
>
> Hint: The cause of this error is usually that your query
contains a reference
> to a field which does not exist. You should verify that
the fields included in
> your query exist and that you have specified their names
correctly.
>
> SQL = "UPDATE feature SET feature.title="Ornaments",
feature.Body='test',
> feature.MYFile='ornement.jpg' WHERE feature.ID = 0"
>
see my first - in 2) in previous post (hint: single quotes
vs. double
quotes)
> 3) How would this be written? <cfqueryparam
> Like this? <cfqueryparam
feature.title="#form.title#">, ...
look in cfml reference. if you do not have one - download
from adobe.com
(download the developer guide, too, while you are at it. and
read it.)
>
> 4) I don't think I need to check for size on this, it is
a thumb nail image
> only. around the upload area on the edit page I have
instructions on the image
> size. BUT, how would I write this to make it work so if
they couldn't read, it
> would throw an error and take them back to the edit
page?
i am not sure what you mean... maybe it is the "few" beers i
had or
maybe t is you... i am not sure... :)
it's 12:40 AM here and i am not at my best now...
> 6) I fixed this am made the absolute path.. I have to
look in the DB for what
> it is placing in there now that it is fixed. it does
however upload the image
> to the folder I pointed to. (Even with it throwing the
error posted in this
> message.)
of course. cffile and cfquery are 2 different animals. if one
fails does
not mean another will, too.
cffile (action=upload) uploads a file from user's computer to
a folder
on the server.
cfquery (update/insert query) enters or updates recordsin the
db. f
course, the 2 are not related a all.
>
> 7) in the area I am working now, I only wanted the name
of the image, not the
> actual image. BUT on the front where the public looks at
the site, do I use:
> <img
src="rel_or_abs_path_to_img_folder/#variables.MYFile#">?
yes. i think so. if you want to actually display the image on
user's screen.
>
> 8) now this one confuses me... I realize I need 2 cffile
statements here, one
> for delete and one for upload. (Right?) I am not sure
how to write it out for
> the upload to look for an existing file, if it exists,
delete it and upload a
> new one. (I want it to do it even if the file name is
different, is that
> possible?)
> Would it look like this? (could you help me write it
out?
>
> Edit page hidden field: <input name="MYFile"
type="hidden"
> value="#variables.MYFile#">
presumed correct.
>
> Action page:
>
> <cfif (len of hidden field=existingFile)>
just len(trim(form.hiddenfieldname)) will suffice.
> <cffile action="delete"
destination="c:/websites/x9vdzd/img/feature"
> file="#form.existingFile#">
aha! you are forgetting the fileexists() part. without
checking for
existence of specified file in the specified folder you are
running a
risk of wiping all files in the folder.... look up
fileexists() in the
cfml reference if you are not familiar with it.
> <cfelse>
> <cfif len(trim(form.MYFile))>
> <cffile Action="upload" filefield="MYFile"
accept="image/gif, image/jpg,
> image/jpeg, image/pjpeg"
destination="c:/websites/x9vdzd/img/feature"
> nameconflict="MAKEUNIQUE"></cfif></cfif>
yep.
>
> Is this right?
with above corrections it should be.
---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com