|
-
Jul 23rd, 2009, 01:33 AM
#1
Thread Starter
Member
execute stored procedure in a class
Hi vbforums. Im a vb 6 newbie. Is it advisable to execute a stored procedure
inside a class
for example:
form
-------------------------
set cSaveDB = new clsSave
cSaveDB.SetName = txtName
cSaveDB.SetAge = txtAge
cSaveDB.WritetoDB
class module
-------------------------
Public Sub WritetoDB
set qy = new ADODB.command
Set qy.activeConnection = cn
qy.commandtext = "sp_Save"
qy.commandType = adCmdStoredPRoc
with qy
.value(1) = Name
.value(2) = Age
end with
set rs = qy.Execute
End Sub
is this a good practice in using class module?
Thanks a lot
Tags for this Thread
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
|