updating database

uncle_scrooge
03-08-2004, 05:52 AM
I have some problems with an update string in my database:

This is working:

strSQL12 = "UPDATE tablename SET age_group = 'Uninvolved' WHERE sample = 'Uninvolved (R.S.)'"

but if i try to put the tablename in a string(table) like this i get an error:

strSQL12 = "UPDATE" & table & "SET age_group = 'Uninvolved' WHERE sample = 'Uninvolved (R.S.)'"

Anyone know why?

reboot
03-08-2004, 06:55 AM
You're missing some spaces

strSQL12 = "UPDATE " & table & " SET age_group = 'Uninvolved' WHERE sample = 'Uninvolved (R.S.)'"

gilou28
03-08-2004, 07:01 AM
strSQL12 = "UPDATE" & table & "SET age_group = 'Uninvolved' WHERE sample = 'Uninvolved (R.S.)'"

I do not see the space between the UPDATE and the table name nor the space after the table name. Unless you add spaces around your table anme in the table variable.

uncle_scrooge
03-08-2004, 07:06 AM
Thanks both of you. its working now!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum