Wrox Programmer Forums
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 29th, 2007, 02:12 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL-syntax

Hei!
Can anyone type in the right syntax on this one for me;

MyConn4.Execute "UPDATE Produkt SET ProduktBilde = '" & <img src = C:/Documents and Settings/a/b/c/d/ '" & '" & File.FileName & '" WHERE ProduktNavn = '" & session("Navn") & "'"

Thanks a lot!

Mvh
grstad
__________________
Internet has become favorable with that tool...thank you Tim Berners-Lee!
 
Old January 29th, 2007, 07:52 PM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to chucky Send a message via AIM to chucky Send a message via MSN to chucky Send a message via Yahoo to chucky
Default

  It looks like you're just missing some quotes.
You needed the apostrophes in double quotes or the code thinks you remarked half of the line.
Try this.

MyConn4.Execute "UPDATE Produkt SET ProduktBilde = "'" & <img src = C:/Documents and Settings/a/b/c/d/ "'" & "'" & File.FileName & "'" WHERE ProduktNavn = "'" & session("Navn") & "'"


 
Old January 30th, 2007, 02:53 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

..thank you for your reply to my inquiry, chucky. I'll try the sql as next ting this morning. Is there any "roules in hand" regarding the use of ' and " in an sql-sentence?

Mvh
grstad :)
 
Old January 30th, 2007, 03:50 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...no, there is still syntax-err;

MyConn4.Execute "UPDATE Produkt SET ProduktBilde = "'" & <img src = C:/Documents and Settings/WebMaster/Mine dokumenter/Ny mappe/brukerfotos/ "'" & "'" & File.FileName & "'" & "'" > "'" WHERE ProduktNavn = "'" & session("Navn") & "'"


...but I have added an "'" > "'" before the WHERE!

Mvh
grstad :)
 
Old January 30th, 2007, 08:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

after reading your sql string several times i realize something.. I don't know what are you trying to achieve!!!

please... if you are so kind, paste an example of the final sql and maybe we can help you better...

The problem I have is with the set clause.. you are trying to put that field equal to..????

and after you add the > you finish confusing me...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
 
Old January 30th, 2007, 10:32 AM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to chucky Send a message via AIM to chucky Send a message via MSN to chucky Send a message via Yahoo to chucky
Default

  I kinda see what he's trying to do;
grstad,
I was in a hurry and put a few quotes in the wrong place as well, try this:

MyConn4.Execute "UPDATE Produkt SET ProduktBilde = '<img src = C:/Documents and Settings/WebMaster/Mine dokumenter/Ny mappe/brukerfotos/" & File.FileName & "' WHERE ProduktNavn = '" & session("Navn") & "'"

By the way, this looks like you might be coding in ASP, I would highly recommend you get PrimalScript or some debugging tool, because all your problem was is putting the quotes in the proper place.

If this doesn't work then you will need to do like gbianchi says and give us some more details on what you are trying to accomplish.

 
Old January 30th, 2007, 10:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

in that case.. you have the > missing ;)

... & File.FileName & ">' WHERE....

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
 
Old January 30th, 2007, 12:40 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...yes it is all aboat putting the quotes in the right place. I try to update my recordfield setting it equal;

<img src="c:/dir_a/dir_b/image_name.gif">

I am so grateful for your attention. By the way; are there any roules for me to follow concerning these quotes? What are the logic?

I will try your suggestion first ting this evening!

Mvh
grstad :)
 
Old January 30th, 2007, 12:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

mm.. how to put quotes is standard SQL.. every string (fixed text) has to be rounded by them...



HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
 
Old January 30th, 2007, 02:40 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...it went ok, exept from the last ">" did not show up in the db-field. The field should be;

<img src = "C:/some_dir/some_dir/some_photo.gif" height = "125" width = "100">

The quotes...yes, the fixed text. And the & binding parts together? And a " followed by a " is wrong; that is why it'll be '" or "' ?

MVH
grstad :)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help with SQL syntax DeannaF829 VB Databases Basics 2 April 30th, 2007 12:12 PM
syntax of sum in SQL heghtera Access VBA 1 March 10th, 2006 03:17 AM
SQL Syntax yves SQL Server 2000 6 February 2nd, 2006 08:26 PM
SQL Syntax Cinderella Classic ASP Basics 3 July 21st, 2004 01:06 PM
SQL Syntax jeffg22 SQL Language 6 July 28th, 2003 06:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.