|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL apparently not executing
Code:
If SQL > "" Then CurrentDb().Execute (SQL) SQL is a text string that updates specific fields of specific records. The above code gets executed when the "Save With Exit" command button is clicked. The SQL is kosher ... that is, when cut and pasted into a query in the access database, it runs with no errors and the appropriate record gets updated. The problem is, when it is run from code, "CurrentDb().Execute (SQL)" the changes are NOT evident in the table. Note: I have also used DoCmd.RunSQL(SQL) No error messages are given. ANy suggestions? |
|
#2
|
||||
|
||||
|
What language are you using?
Have you setup all the connection and recordset object correctly. If you're using ASP, I believe the correct code should be: objDBcon.Execute(strSQL) - ie. remove the braces after your conn object. |
|
#3
|
|||
|
|||
|
if I am not mistaken and you are using asp than the correct syntax for executing a sql statement without a recordset is
Code:
CurrentDB.Execute strSQL If you are using a row returning recordset than the correct syntax is: Code:
Set oRS = CurrentDB.Execute(strsQL) So in case of a recordset you need the brackets.
__________________
- Rogier Doekes |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > SQL apparently not executing |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|