|
No problem
|
|
|
|
|
Dear All, Am getting sytex error , Missing operator on the following:
sqls = "SELECT c_number, c_description, c_scope, c_category, c_type FROM tb_c WHERE c_scope = " & scope & " AND c_number In select c_number FROM tb_c_details WHERE e_id = " & eid
set rst = db.openrecordset (sqls)
Cant find any missing operator , also i used a msgbox to show sqls , the statement is perfect.
Helpppp !!!
0 will always beats the 1.
|
|
|
|
|
scorp_scorp wrote: Helpppp !!!
All examples I've seen have parentheses following the IN keyword...
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Modified to:
sqls = "SELECT c_number, c_description, c_scope, c_category, c_type FROM tb_c WHERE c_scope = " & scope & " AND c_number In ( select c_number FROM tb_c_details WHERE e_id = " & eid & " )"
Didnt work ... same problem
Any different statment that would give me the same results ??? since i think the error is from the IN phrase .
0 will always beats the 1.
modified on Sunday, February 13, 2011 2:51 AM
|
|
|
|
|
If you alreasy corrected the in clause, are the scope and eid variables containing character values? If theay are they should be between ''.
You could also post the contents of the sqls variable in order to see what's the actual statement that's executed against the database.
|
|
|
|
|
scope is a string and eid is a int.
dim scope as string
dim eid as integer
scope = CStr(Forms![report_testin]![Combo42].Value)
eid =Int(Forms![report_testin]![Combo29].Value)
ami defining the string sqls wrong???
I also tried to modify sqls to be:
sqls = "SELECT distinct c_number, c_description FROM tb_c INNER JOIN tb_c_details ON tb_c.c_number = tb_c_details.c_number WHERE e_id = " & eid
It generates another Error:
"The specifies Field 'c_number' could refer to more than one table listed in the FROM clause of your sql statement"
but it doesnt make sense for me
0 will always beats the 1.
modified on Sunday, February 13, 2011 4:08 AM
|
|
|
|
|
If scope is a string your statement should be something like
sqls = "SELECT c_number, c_description, c_scope, c_category, c_type " & _
FROM tb_c " & _
WHERE c_scope = '" & scope & "' " & _
AND c_number IN ( SELECT c_number " & _
FROM tb_c_details " & _
WHERE e_id = " & eid & " )"
Also instead of using literals (concatenated values) in your statement you should use bind variables. This way you're more safe from SQL injections, datatype mismatches, syntax errors etc
[addition]
Concenring the latter error, you should use aliases in the select portion. Like:
SELECT distinct tb_c.c_number, tb_c.c_description ...
|
|
|
|
|
|
No problem
|
|
|
|
|
How to make auto number start from 2000 not in 1. I use MS Access 2003 database
|
|
|
|
|
|
I create my database in MS Access before use it.
|
|
|
|
|
Yes, the article covers also database creation etc, but the point is that with a little macro you can modify the properties of your tables columns.
I don't have Access at the moment but I would guess that some macro like:
CurrentDb.TableDefs("TableNameGoesHere").Fields("FieldNameOverHere").DefaultValue = "2000"
would be worth trying.
|
|
|
|
|
This[^] may help.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Hi,
WhenI tried to install SQL Server 2005, it installs all the compnents except when it tries to install Database Services it was not able to start the service automatically and later it says it failed in installing Database Services, any information on this would be greatly appreciated.
Thanks
|
|
|
|
|
Did you install SQL Server 2005 SP2 since previous versions are not supported on Vista?
Also did you run the install as Administrator in order to have necessary privileges.
You could include the exact error messages in your post since that would help in locating the problem.
Regards,
mika
|
|
|
|
|
I had this problem before and you should know that its really easy and simple to solve it
whether you are installing sql server on vista or seven you should run the installation as administrator
another suggestion: if you are the only user on this pc you may find it useful to make your default user the administrator
because lots of things on vista and seven really needs administrator previliges to wrok the right way
and if you dont have good experience and afraid of missing something just keep the User Account Control turned on
and whenever you will do something that might need a permission it will show you a confirmation message even if you are using the adminitrator account
I hope it helped
|
|
|
|
|
Dear sir/madam
i want to connect the database that in sql server 2000
pls give some sample coding to insert and update , delete
regards
k7
|
|
|
|
|
No problem
INSERT appropriate,keywords INTO GoogleSearchBox WHERE examples = abundant
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I think I might steal that one.
|
|
|
|
|
I was thinking
UPDATE User SET Clue=@Clue WHERE Clue IS NULL
|
|
|
|
|
that one would throw a SystemOverloadedException
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Amazing way to answer Luc..
You stole the show...
|
|
|
|
|
please let me know the difference b/w clustered and non-clustered index... in sQL server in
simple language....eventhough i searched in google im not clear abt the exact diff
and in which scenario use these indexes...(clustered and non clustered)
|
|
|
|
|
Basically the main difference is that both are B-tree indexes but clustered index causes the data in the table to be sorted based on the indexed columns. This is why a single table cannot have multiple clustered indexes. Nonclustered index is like an index at the end of a book. Entries are sorted and there are pointers (page numbers in book) referencing the actual place for the data.
Have a look at this: Nonclustered Index Structures
[^]
Regards,
mika
|
|
|
|