VB.Net / VBScript Integration

J

Jonathan Allen

With VB6, I stored a lot of user-defined business rules in a database as
VBScript. The VB application would load and run the script as needed. They
were fairly simple, mainly field validation.

Is there a way to do this in VB.Net? (I am willing to use VB.Net instead of
VBScript, so long as I can still store it as clear text rather than in a
compiled form.)

Jonathan
 
C

Chris, Master of All Things Insignificant

Can you do it as a stored procedure? This seems like a better more
efficient way of going about it.

Chris
 
J

Jonathan Allen

No, that wouldn't work. The process is...

1. New record is created OR Existing record is opened
2. User inputs changes
3. User hits "Calculate" button. VBScript auto-fills as many fields as it
can.
4. User overrides any values they need to.
5. User hits "Save" button. VBScript validates form.
6. Data is sent to the database.

Each form has its own rules, and those rules change on a regular basis.
(When I say form, I mean it in the generic sense. I have a single VB Form
that uses info in the database to create the form.)

Jonathan
 
J

Jonathan Allen

How would I convert....

Sub Calculate
Cost = 47.25 * Hours
End Sub
Function Validate
Validate = (Cost >0) OR (Checkbox2.Checked = True)
End Function

.... into XML?

Jonathan
 
M

Michael Harris \(MVP\)

With VB6, I stored a lot of user-defined business rules in a database
as VBScript. The VB application would load and run the script as
needed. They were fairly simple, mainly field validation.

Is there a way to do this in VB.Net? (I am willing to use VB.Net
instead of VBScript, so long as I can still store it as clear text
rather than in a compiled form.)

I assume you use the MSScriptControl.ScriptControl to do this from VB6.

You can still use that same COM component via COM interop in VB.Net.

Google Search
http://groups-beta.google.com/group...p:*.dotnet&hl=en&lr=lang_en&num=100&scoring=d


Or you can work out the details of being a VSA host and support scripts
written in VB.Net.

Script Happens .NET
http://msdn.microsoft.com/library/en-us/dnclinic/html/scripting06112001.asp

microsoft.public.dotnet.scripting is the related NG if you go the VSA
route...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top