Link to home
Start Free TrialLog in
Avatar of thach1ef2
thach1ef2

asked on

VB6 - rs.execute command help

I'm working on a script that someone else had written and I'm trying to understand what the following lines of code do. I couldn't find anything useful online as I think my search was too broad and I didn't know enough about what was happening in order to narrow it down.

So I understand the IF statement. I'm just not really sure what this execute command is actually doing.


If GetSetting(App.Title, "Settings", "Process", "All") = "All" Then
 db.Execute "Update [" & strExcelInputSheetTab & "$] SET Status = ''"
End If

Open in new window

Avatar of joachim58
joachim58

db.execute in VB6/ADO  is  similar to ExecuteNonQuery
the db-object has an open connection to the database

in ADO .NET 2 it would be:

Dim cmd AS New SQLCommand( conn, "Update [" & strExcelInputSheetTab & "$] SET Status = ''"
cmd.ExecuteNonQuery 

Open in new window


You can add the line

 MsgBox(strExcelInputSheetTab)

Open in new window


to see the information needed to complete the SQL statement.

I cannot say what the dollar sign means. Oracle stores it's data dictionary in tables ending with the dollar sign.










Avatar of thach1ef2

ASKER

I apologize but I still can't tell what the execute command does from your explanation.
Another hint concerning the $ sign: Someone in my team used the excel to import data from a spreadsheet to a  SQL Server Table, and that generated tablenames that end with a Dollarsign.
Haha thank you, however I'm trying to find out what the execute statement is doing. I understand the $ sign and the variable strExcelInputSheetTab. I don't understand what the execute command is doing...
It executes the SQL statement that is passed as a parameter on the database-connection represented by the db-object.

You need to know the value of strExcelInputSheetTab  to see what SQL statement is actually passed.
ASKER CERTIFIED SOLUTION
Avatar of VBClassicGuy
VBClassicGuy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The response given gave me enough information to figure out the answer.