AddParameter and SetParameter scope

BPak

Active Member
Licensed User
Longtime User
Does the Command.AddParameter and SetParameter have a scope?

Do the settings only hold while in the SUB?
 

mjcoon

Well-Known Member
Licensed User
Does the Command.AddParameter and SetParameter have a scope?

Do the settings only hold while in the SUB?

I'm confident that SQLite knows nothing of B4P Subs, so the scope will be Global, like that of the Command object. Do you have a reason to think otherwise?

(As I have said before, I think that, in the code that you published here, you overdo your use of SQL parameters. I read the SQL descriptions as implying that parameters are (only?) useful when multiple SQL calls use the same value of a parameter.)

Mike.
 

BPak

Active Member
Licensed User
Longtime User
Mike

Using the AddParameters then if it is Global in the Command would hold heaps of Added Parameters over a session if there were numerous fields in the TABLES.

And if once added then we do not need to add them every time we enter a sub to do Database work that uses these parameters. The example code I have seen does the AddParameter and SetParameter each time the Sub is called.

I was thinking that maybe by setting the Add and Set Parameters when opening the Form may only be needed ONCE throughout the session if the Parameter data is held in the Command throughout the life of the Form??

(As I have said before, I think that, in the code that you published here, you overdo your use of SQL parameters. I read the SQL descriptions as implying that parameters are (only?) useful when multiple SQL calls use the same value of a parameter.)

I will look for some other examples on how to Insert and Update Fields in the Table without Parameters. ?
 
Top