|
-
Feb 18th, 2001, 12:33 PM
#1
Thread Starter
Lively Member
I'm new to the VB/SQL Server world and am having the following problem:
I get timeouts when executing either UPDATEs or DELETEs. INSERTs work fine.
Here's the code ("PROJ_DB" is the connection):
g_sSQL = "UPDATE tblRefI SET strType='A',sngRefI=1.23 WHERE strType='A';"
PROJ_DB.Execute g_sSQL, , adCmdText
and
g_sSQL = "DELETE FROM tblRefI WHERE strType='X';"
PROJ_DB.Execute g_sSQL, , adCmdText
and
g_sSQL = "INSERT INTO tblRefI (strType,sngRefI) VALUES('A',123);"
PROJ_DB.Execute g_sSQL, , adCmdText
If anyone can help, I'd really appreciate it. Thanks.
-
Feb 19th, 2001, 07:10 AM
#2
Lively Member
If you don't need to return records bask after update/delete, try to set parameter RecordsAffected=none in execute statement. This will reduce time needed for executing the query and maybe it will help
-
Feb 19th, 2001, 08:48 AM
#3
Thread Starter
Lively Member
Vit:
Thanks. I should mention that the table I'm testing my code on is a maintenance table with only 5 records.
Could it have something to do with the WHERE phrase??
-
Feb 20th, 2001, 04:07 AM
#4
Lively Member
No, it's a correct syntax
-
Feb 20th, 2001, 05:33 AM
#5
Hyperactive Member
Really the correct syntax for comparing strings in SQL is where
mythingy like 'A'
as opposed to
mythingy = 'A'
but I can't see that it would make a difference to what you are doing here......
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|